diff --git a/.eslintrc.json b/.eslintrc.json index 31cdaead..f1f72047 100644 --- a/.eslintrc.json +++ b/.eslintrc.json @@ -21,10 +21,12 @@ "ecmaVersion": 2017 }, "plugins": [ - "prettier" + "prettier", + "eslint-plugin-tsdoc" ], "rules": { "prettier/prettier": "error", + "tsdoc/syntax": "warn", "no-console": "off", "eqeqeq": [ "error", @@ -33,11 +35,23 @@ "null": "ignore" } ], + "@typescript-eslint/no-unused-vars": [ + "error", + { + "argsIgnorePattern": "^_" + } + ], "strict": [ "error", "global" ], - "@typescript-eslint/ban-types": "off", - "@typescript-eslint/no-var-requires": "off" + "@typescript-eslint/ban-types": [ + "error", + { + "types": { + "Function": false + } + } + ] } } diff --git a/api-extractor.json b/api-extractor.json index 0772c805..5fc3c79d 100644 --- a/api-extractor.json +++ b/api-extractor.json @@ -26,7 +26,7 @@ "logLevel": "warning" }, "ae-internal-missing-underscore": { - "logLevel": "none", + "logLevel": "error", "addToApiReportFile": false }, "ae-missing-release-tag": { @@ -39,7 +39,7 @@ }, "ae-unresolved-link": { "addToApiReportFile": false, - "logLevel": "none" + "logLevel": "error" } }, "tsdocMessageReporting": { diff --git a/karma.conf.js b/karma.conf.js index 54329a59..2962f947 100644 --- a/karma.conf.js +++ b/karma.conf.js @@ -40,15 +40,19 @@ module.exports = function (config) { output: { format: 'iife', name: 'BSONtest', - sourcemap: true, + sourcemap: 'inline', exports: 'named' + }, + onwarn(warning) { + if (warning.code === 'CIRCULAR_DEPENDENCY') return; + console.warn(warning.toString()); } }, // test results reporter to use // possible values: 'dots', 'progress' // available reporters: https://npmjs.org/browse/keyword/karma-reporter - reporters: ['progress'], + reporters: ['mocha'], // web server port port: 9876, @@ -79,6 +83,9 @@ module.exports = function (config) { // Concurrency level // how many browser should be started simultaneous - concurrency: 1 + concurrency: 1, + + // Console log print outs will be prefaced with `LOG:` for grep + client: { captureConsole: true } }); }; diff --git a/package-lock.json b/package-lock.json index 91b30f1f..80e61eff 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7,7 +7,7 @@ "@babel/code-frame": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", - "integrity": "sha1-Fo2ho26Q2miujUnA8bSMfGJJITo=", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", "dev": true, "requires": { "@babel/highlight": "^7.10.4" @@ -16,7 +16,7 @@ "@babel/compat-data": { "version": "7.11.0", "resolved": "https://registry.npmjs.org/@babel/compat-data/-/compat-data-7.11.0.tgz", - "integrity": "sha1-6fc+/gmvE1W3I6fzmxG61jfXyZw=", + "integrity": "sha512-TPSvJfv73ng0pfnEOh17bYMPQbI95+nGWc71Ss4vZdRBHTDqmM9Z8ZV4rYz8Ks7sfzc95n30k6ODIq5UGnXcYQ==", "dev": true, "requires": { "browserslist": "^4.12.0", @@ -25,19 +25,19 @@ } }, "@babel/core": { - "version": "7.11.4", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.4.tgz", - "integrity": "sha1-QwHf36+gHuuX8YlsVQGj8GVdQik=", + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.11.6.tgz", + "integrity": "sha512-Wpcv03AGnmkgm6uS6k8iwhIwTrcP0m17TL1n1sy7qD0qelDu4XNeW0dN0mHfa+Gei211yDaLoEe/VlbXQzM4Bg==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.4", + "@babel/generator": "^7.11.6", "@babel/helper-module-transforms": "^7.11.0", "@babel/helpers": "^7.10.4", - "@babel/parser": "^7.11.4", + "@babel/parser": "^7.11.5", "@babel/template": "^7.10.4", - "@babel/traverse": "^7.11.0", - "@babel/types": "^7.11.0", + "@babel/traverse": "^7.11.5", + "@babel/types": "^7.11.5", "convert-source-map": "^1.7.0", "debug": "^4.1.0", "gensync": "^1.0.0-beta.1", @@ -49,12 +49,12 @@ } }, "@babel/generator": { - "version": "7.11.4", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.4.tgz", - "integrity": "sha1-HsfuwA3vul1vg+UOPucq4v7kgr4=", + "version": "7.11.6", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.11.6.tgz", + "integrity": "sha512-DWtQ1PV3r+cLbySoHrwn9RWEgKMBLLma4OBQloPRyDYvc5msJM9kvTLo1YnlJd1P/ZuKbdli3ijr5q3FvAF3uA==", "dev": true, "requires": { - "@babel/types": "^7.11.0", + "@babel/types": "^7.11.5", "jsesc": "^2.5.1", "source-map": "^0.5.0" } @@ -62,7 +62,7 @@ "@babel/helper-annotate-as-pure": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.10.4.tgz", - "integrity": "sha1-W/DUlaP3V6w72ki1vzs7ownHK6M=", + "integrity": "sha512-XQlqKQP4vXFB7BN8fEEerrmYvHp3fK/rBkRFz9jaJbzK0B1DSfej9Kc7ZzE8Z/OnId1jpJdNAZ3BFQjWG68rcA==", "dev": true, "requires": { "@babel/types": "^7.10.4" @@ -71,7 +71,7 @@ "@babel/helper-builder-binary-assignment-operator-visitor": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.10.4.tgz", - "integrity": "sha1-uwt18xv5jL+f8UPBrleLhydK4aM=", + "integrity": "sha512-L0zGlFrGWZK4PbT8AszSfLTM5sDU1+Az/En9VrdT8/LmEiJt4zXt+Jve9DCAnQcbqDhCI+29y/L93mrDzddCcg==", "dev": true, "requires": { "@babel/helper-explode-assignable-expression": "^7.10.4", @@ -81,7 +81,7 @@ "@babel/helper-compilation-targets": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-compilation-targets/-/helper-compilation-targets-7.10.4.tgz", - "integrity": "sha1-gEro4/BDdmB8x5G51H1UAnYzK9I=", + "integrity": "sha512-a3rYhlsGV0UHNDvrtOXBg8/OpfV0OKTkxKPzIplS1zpx7CygDcWWxckxZeDd3gzPzC4kUT0A4nVFDK0wGMh4MQ==", "dev": true, "requires": { "@babel/compat-data": "^7.10.4", @@ -94,7 +94,7 @@ "@babel/helper-create-class-features-plugin": { "version": "7.10.5", "resolved": "https://registry.npmjs.org/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.10.5.tgz", - "integrity": "sha1-n2FEa6gOgkCwpchcb9rIRZ1vJZ0=", + "integrity": "sha512-0nkdeijB7VlZoLT3r/mY3bUkw3T8WG/hNw+FATs/6+pG2039IJWjTYL0VTISqsNHMUTEnwbVnc89WIJX9Qed0A==", "dev": true, "requires": { "@babel/helper-function-name": "^7.10.4", @@ -108,7 +108,7 @@ "@babel/helper-create-regexp-features-plugin": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.10.4.tgz", - "integrity": "sha1-/dYNiFJGWaC2lZwFeZJeQlcU87g=", + "integrity": "sha512-2/hu58IEPKeoLF45DBwx3XFqsbCXmkdAay4spVr2x0jYgRxrSNp+ePwvSsy9g6YSaNDcKIQVPXk1Ov8S2edk2g==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.10.4", @@ -119,7 +119,7 @@ "@babel/helper-define-map": { "version": "7.10.5", "resolved": "https://registry.npmjs.org/@babel/helper-define-map/-/helper-define-map-7.10.5.tgz", - "integrity": "sha1-tTwQ23imQIABUmkrEzkxR6y5uzA=", + "integrity": "sha512-fMw4kgFB720aQFXSVaXr79pjjcW5puTCM16+rECJ/plGS+zByelE8l9nCpV1GibxTnFVmUuYG9U8wYfQHdzOEQ==", "dev": true, "requires": { "@babel/helper-function-name": "^7.10.4", @@ -130,7 +130,7 @@ "@babel/helper-explode-assignable-expression": { "version": "7.11.4", "resolved": "https://registry.npmjs.org/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.11.4.tgz", - "integrity": "sha1-LY40cCUswXq6kX7eeAPUp6J2pBs=", + "integrity": "sha512-ux9hm3zR4WV1Y3xXxXkdG/0gxF9nvI0YVmKVhvK9AfMoaQkemL3sJpXw+Xbz65azo8qJiEz2XVDUpK3KYhH3ZQ==", "dev": true, "requires": { "@babel/types": "^7.10.4" @@ -139,7 +139,7 @@ "@babel/helper-function-name": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.10.4.tgz", - "integrity": "sha1-0tOyDFmtjEcRL6fSqUvAnV74Lxo=", + "integrity": "sha512-YdaSyz1n8gY44EmN7x44zBn9zQ1Ry2Y+3GTA+3vH6Mizke1Vw0aWDM66FOYEPw8//qKkmqOckrGgTYa+6sceqQ==", "dev": true, "requires": { "@babel/helper-get-function-arity": "^7.10.4", @@ -150,7 +150,7 @@ "@babel/helper-get-function-arity": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.10.4.tgz", - "integrity": "sha1-mMHL6g4jMvM/mkZhuM4VBbLBm6I=", + "integrity": "sha512-EkN3YDB+SRDgiIUnNgcmiD361ti+AVbL3f3Henf6dqqUyr5dMsorno0lJWJuLhDhkI5sYEpgj6y9kB8AOU1I2A==", "dev": true, "requires": { "@babel/types": "^7.10.4" @@ -159,7 +159,7 @@ "@babel/helper-hoist-variables": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-hoist-variables/-/helper-hoist-variables-7.10.4.tgz", - "integrity": "sha1-1JsAHR1aaMpeZgTdoBpil/fJOB4=", + "integrity": "sha512-wljroF5PgCk2juF69kanHVs6vrLwIPNp6DLD+Lrl3hoQ3PpPPikaDRNFA+0t81NOoMt2DL6WW/mdU8k4k6ZzuA==", "dev": true, "requires": { "@babel/types": "^7.10.4" @@ -168,7 +168,7 @@ "@babel/helper-member-expression-to-functions": { "version": "7.11.0", "resolved": "https://registry.npmjs.org/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.11.0.tgz", - "integrity": "sha1-rmnIPYTugvS0L5bioJQQk1qPJt8=", + "integrity": "sha512-JbFlKHFntRV5qKw3YC0CvQnDZ4XMwgzzBbld7Ly4Mj4cbFy3KywcR8NtNctRToMWJOVvLINJv525Gd6wwVEx/Q==", "dev": true, "requires": { "@babel/types": "^7.11.0" @@ -177,7 +177,7 @@ "@babel/helper-module-imports": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.10.4.tgz", - "integrity": "sha1-TFxUvgS9MWcKc4J5fXW5+i5bViA=", + "integrity": "sha512-nEQJHqYavI217oD9+s5MUBzk6x1IlvoS9WTPfgG43CbMEeStE0v+r+TucWdx8KFGowPGvyOkDT9+7DHedIDnVw==", "dev": true, "requires": { "@babel/types": "^7.10.4" @@ -186,7 +186,7 @@ "@babel/helper-module-transforms": { "version": "7.11.0", "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.11.0.tgz", - "integrity": "sha1-sW8lAinkchGr3YSzS2RzfCqy01k=", + "integrity": "sha512-02EVu8COMuTRO1TAzdMtpBPbe6aQ1w/8fePD2YgQmxZU4gpNWaL9gK3Jp7dxlkUlUCJOTaSeA+Hrm1BRQwqIhg==", "dev": true, "requires": { "@babel/helper-module-imports": "^7.10.4", @@ -201,7 +201,7 @@ "@babel/helper-optimise-call-expression": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.10.4.tgz", - "integrity": "sha1-UNyWQT1ZT5lad5BZBbBYk813lnM=", + "integrity": "sha512-n3UGKY4VXwXThEiKrgRAoVPBMqeoPgHVqiHZOanAJCG9nQUL2pLRQirUzl0ioKclHGpGqRgIOkgcIJaIWLpygg==", "dev": true, "requires": { "@babel/types": "^7.10.4" @@ -210,13 +210,13 @@ "@babel/helper-plugin-utils": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.10.4.tgz", - "integrity": "sha1-L3WoMSadT2d95JmG3/WZJ1M883U=", + "integrity": "sha512-O4KCvQA6lLiMU9l2eawBPMf1xPP8xPfB3iEQw150hOVTqj/rfXz0ThTb4HEzqQfs2Bmo5Ay8BzxfzVtBrr9dVg==", "dev": true }, "@babel/helper-regex": { "version": "7.10.5", "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.10.5.tgz", - "integrity": "sha1-Mt+7eYmQc8QVVXBToZvQVarlCuA=", + "integrity": "sha512-68kdUAzDrljqBrio7DYAEgCoJHxppJOERHOgOrDN7WjOzP0ZQ1LsSDRXcemzVZaLvjaJsJEESb6qt+znNuENDg==", "dev": true, "requires": { "lodash": "^4.17.19" @@ -225,7 +225,7 @@ "@babel/helper-remap-async-to-generator": { "version": "7.11.4", "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.11.4.tgz", - "integrity": "sha1-RHTqn3Q48YV14wsMrHhARbQCoS0=", + "integrity": "sha512-tR5vJ/vBa9wFy3m5LLv2faapJLnDFxNWff2SAYkSE4rLUdbp7CdObYFgI7wK4T/Mj4UzpjPwzR8Pzmr5m7MHGA==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.10.4", @@ -237,7 +237,7 @@ "@babel/helper-replace-supers": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-replace-supers/-/helper-replace-supers-7.10.4.tgz", - "integrity": "sha1-1YXNk4jqBuYDHkzUS2cTy+rZ5s8=", + "integrity": "sha512-sPxZfFXocEymYTdVK1UNmFPBN+Hv5mJkLPsYWwGBxZAxaWfFu+xqp7b6qWD0yjNuNL2VKc6L5M18tOXUP7NU0A==", "dev": true, "requires": { "@babel/helper-member-expression-to-functions": "^7.10.4", @@ -249,7 +249,7 @@ "@babel/helper-simple-access": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.10.4.tgz", - "integrity": "sha1-D1zNopRSd6KnotOoIeFTle3PNGE=", + "integrity": "sha512-0fMy72ej/VEvF8ULmX6yb5MtHG4uH4Dbd6I/aHDb/JVg0bbivwt9Wg+h3uMvX+QSFtwr5MeItvazbrc4jtRAXw==", "dev": true, "requires": { "@babel/template": "^7.10.4", @@ -259,7 +259,7 @@ "@babel/helper-skip-transparent-expression-wrappers": { "version": "7.11.0", "resolved": "https://registry.npmjs.org/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.11.0.tgz", - "integrity": "sha1-7sFi8RLC9Y068K8SXju1dmUUZyk=", + "integrity": "sha512-0XIdiQln4Elglgjbwo9wuJpL/K7AGCY26kmEt0+pRP0TAj4jjyNq1MjoRvikrTVqKcx4Gysxt4cXvVFXP/JO2Q==", "dev": true, "requires": { "@babel/types": "^7.11.0" @@ -268,7 +268,7 @@ "@babel/helper-split-export-declaration": { "version": "7.11.0", "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.11.0.tgz", - "integrity": "sha1-+KSRJErPamdhWKxCBykRuoOtCZ8=", + "integrity": "sha512-74Vejvp6mHkGE+m+k5vHY93FX2cAtrw1zXrZXRlG4l410Nm9PxfEiVTn1PjDPV5SnmieiueY4AFg2xqhNFuuZg==", "dev": true, "requires": { "@babel/types": "^7.11.0" @@ -277,13 +277,13 @@ "@babel/helper-validator-identifier": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.10.4.tgz", - "integrity": "sha1-p4x6clHgH2FlEtMbEK3PUq2l4NI=", + "integrity": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", "dev": true }, "@babel/helper-wrap-function": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.10.4.tgz", - "integrity": "sha1-im9wHqsP8592W1oc/vQJmQ5iS4c=", + "integrity": "sha512-6py45WvEF0MhiLrdxtRjKjufwLL1/ob2qDJgg5JgNdojBAZSAKnAjkyOCNug6n+OBl4VW76XjvgSFTdaMcW0Ug==", "dev": true, "requires": { "@babel/helper-function-name": "^7.10.4", @@ -295,7 +295,7 @@ "@babel/helpers": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.10.4.tgz", - "integrity": "sha1-Kr6w1yGv98Cpc3a54fb2XXpHUEQ=", + "integrity": "sha512-L2gX/XeUONeEbI78dXSrJzGdz4GQ+ZTA/aazfUsFaWjSe95kiCuOZ5HsXvkiw3iwF+mFHSRUfJU8t6YavocdXA==", "dev": true, "requires": { "@babel/template": "^7.10.4", @@ -306,7 +306,7 @@ "@babel/highlight": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", - "integrity": "sha1-fRvf1ldTU4+r5sOFls23bZrGAUM=", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -315,15 +315,15 @@ } }, "@babel/parser": { - "version": "7.11.4", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.4.tgz", - "integrity": "sha1-b6GhGLiw2A0CZ7cZIT3JR+iMwMo=", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.11.5.tgz", + "integrity": "sha512-X9rD8qqm695vgmeaQ4fvz/o3+Wk4ZzQvSHkDBgpYKxpD4qTAUm88ZKtHkVqIOsYFFbIQ6wQYhC6q7pjqVK0E0Q==", "dev": true }, "@babel/plugin-proposal-async-generator-functions": { "version": "7.10.5", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.10.5.tgz", - "integrity": "sha1-NJHKvy98F5q4IGBs7Cf+0V4OhVg=", + "integrity": "sha512-cNMCVezQbrRGvXJwm9fu/1sJj9bHdGAgKodZdLqOQIpfoH3raqmRPBM17+lh7CzhiKRRBrGtZL9WcjxSoGYUSg==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4", @@ -334,7 +334,7 @@ "@babel/plugin-proposal-class-properties": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.10.4.tgz", - "integrity": "sha1-ozv2Mto5ClnHqMVwBF0RFc13iAc=", + "integrity": "sha512-vhwkEROxzcHGNu2mzUC0OFFNXdZ4M23ib8aRRcJSsW8BZK9pQMD7QB7csl97NBbgGZO7ZyHUyKDnxzOaP4IrCg==", "dev": true, "requires": { "@babel/helper-create-class-features-plugin": "^7.10.4", @@ -344,7 +344,7 @@ "@babel/plugin-proposal-dynamic-import": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.10.4.tgz", - "integrity": "sha1-uleibLmLN3QenVvKG4sN34KR8X4=", + "integrity": "sha512-up6oID1LeidOOASNXgv/CFbgBqTuKJ0cJjz6An5tWD+NVBNlp3VNSBxv2ZdU7SYl3NxJC7agAQDApZusV6uFwQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4", @@ -354,7 +354,7 @@ "@babel/plugin-proposal-export-namespace-from": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.10.4.tgz", - "integrity": "sha1-Vw2IO5EDFjez4pWO6jxDjmLAX1Q=", + "integrity": "sha512-aNdf0LY6/3WXkhh0Fdb6Zk9j1NMD8ovj3F6r0+3j837Pn1S1PdNtcwJ5EG9WkVPNHPxyJDaxMaAOVq4eki0qbg==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4", @@ -364,7 +364,7 @@ "@babel/plugin-proposal-json-strings": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.10.4.tgz", - "integrity": "sha1-WT5ZxjUoFgIzvTIbGuvgggwjQds=", + "integrity": "sha512-fCL7QF0Jo83uy1K0P2YXrfX11tj3lkpN7l4dMv9Y9VkowkhkQDwFHFd8IiwyK5MZjE8UpbgokkgtcReH88Abaw==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4", @@ -374,7 +374,7 @@ "@babel/plugin-proposal-logical-assignment-operators": { "version": "7.11.0", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.11.0.tgz", - "integrity": "sha1-n4DkgsAwg8hxJd7hACa1hSfqIMg=", + "integrity": "sha512-/f8p4z+Auz0Uaf+i8Ekf1iM7wUNLcViFUGiPxKeXvxTSl63B875YPiVdUDdem7hREcI0E0kSpEhS8tF5RphK7Q==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4", @@ -384,7 +384,7 @@ "@babel/plugin-proposal-nullish-coalescing-operator": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.10.4.tgz", - "integrity": "sha1-AqfpYfwy5tWy2wZJ4Bv4Dd7n4Eo=", + "integrity": "sha512-wq5n1M3ZUlHl9sqT2ok1T2/MTt6AXE0e1Lz4WzWBr95LsAZ5qDXe4KnFuauYyEyLiohvXFMdbsOTMyLZs91Zlw==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4", @@ -394,7 +394,7 @@ "@babel/plugin-proposal-numeric-separator": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.10.4.tgz", - "integrity": "sha1-zhWQ/wplrRKXCmCdeIVemkwa7wY=", + "integrity": "sha512-73/G7QoRoeNkLZFxsoCCvlg4ezE4eM+57PnOqgaPOozd5myfj7p0muD1mRVJvbUWbOzD+q3No2bWbaKy+DJ8DA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4", @@ -404,7 +404,7 @@ "@babel/plugin-proposal-object-rest-spread": { "version": "7.11.0", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.11.0.tgz", - "integrity": "sha1-vYH5Wh90Z2DqQ7bC09YrEXkK0K8=", + "integrity": "sha512-wzch41N4yztwoRw0ak+37wxwJM2oiIiy6huGCoqkvSTA9acYWcPfn9Y4aJqmFFJ70KTJUu29f3DQ43uJ9HXzEA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4", @@ -415,7 +415,7 @@ "@babel/plugin-proposal-optional-catch-binding": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.10.4.tgz", - "integrity": "sha1-Mck4MJ0kp4pJ1o/av/qoY3WFVN0=", + "integrity": "sha512-LflT6nPh+GK2MnFiKDyLiqSqVHkQnVf7hdoAvyTnnKj9xB3docGRsdPuxp6qqqW19ifK3xgc9U5/FwrSaCNX5g==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4", @@ -425,7 +425,7 @@ "@babel/plugin-proposal-optional-chaining": { "version": "7.11.0", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.11.0.tgz", - "integrity": "sha1-3lhm0GRvav2quKVmOC/joiF1UHY=", + "integrity": "sha512-v9fZIu3Y8562RRwhm1BbMRxtqZNFmFA2EG+pT2diuU8PT3H6T/KXoZ54KgYisfOFZHV6PfvAiBIZ9Rcz+/JCxA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4", @@ -436,7 +436,7 @@ "@babel/plugin-proposal-private-methods": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.10.4.tgz", - "integrity": "sha1-sWDZcrj9ulx9ERoUX8jEIfwqaQk=", + "integrity": "sha512-wh5GJleuI8k3emgTg5KkJK6kHNsGEr0uBTDBuQUBJwckk9xs1ez79ioheEVVxMLyPscB0LfkbVHslQqIzWV6Bw==", "dev": true, "requires": { "@babel/helper-create-class-features-plugin": "^7.10.4", @@ -446,7 +446,7 @@ "@babel/plugin-proposal-unicode-property-regex": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.10.4.tgz", - "integrity": "sha1-RIPNpTBBzjQTt/4vAAImZd36p10=", + "integrity": "sha512-H+3fOgPnEXFL9zGYtKQe4IDOPKYlZdF1kqFDQRRb8PK4B8af1vAGK04tF5iQAAsui+mHNBQSAtd2/ndEDe9wuA==", "dev": true, "requires": { "@babel/helper-create-regexp-features-plugin": "^7.10.4", @@ -456,7 +456,7 @@ "@babel/plugin-syntax-async-generators": { "version": "7.8.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz", - "integrity": "sha1-qYP7Gusuw/btBCohD2QOkOeG/g0=", + "integrity": "sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.8.0" @@ -465,7 +465,7 @@ "@babel/plugin-syntax-class-properties": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.10.4.tgz", - "integrity": "sha1-ZkTmoLqlWmH54yMfbJ7rbuRsEkw=", + "integrity": "sha512-GCSBF7iUle6rNugfURwNmCGG3Z/2+opxAMLs1nND4bhEG5PuxTIggDBoeYYSujAlLtsupzOHYJQgPS3pivwXIA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -474,7 +474,7 @@ "@babel/plugin-syntax-dynamic-import": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz", - "integrity": "sha1-Yr+Ysto80h1iYVT8lu5bPLaOrLM=", + "integrity": "sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.8.0" @@ -483,7 +483,7 @@ "@babel/plugin-syntax-export-namespace-from": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz", - "integrity": "sha1-AolkqbqA28CUyRXEh618TnpmRlo=", + "integrity": "sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.8.3" @@ -492,7 +492,7 @@ "@babel/plugin-syntax-json-strings": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz", - "integrity": "sha1-AcohtmjNghjJ5kDLbdiMVBKyyWo=", + "integrity": "sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.8.0" @@ -501,7 +501,7 @@ "@babel/plugin-syntax-logical-assignment-operators": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz", - "integrity": "sha1-ypHvRjA1MESLkGZSusLp/plB9pk=", + "integrity": "sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -510,7 +510,7 @@ "@babel/plugin-syntax-nullish-coalescing-operator": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz", - "integrity": "sha1-Fn7XA2iIYIH3S1w2xlqIwDtm0ak=", + "integrity": "sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.8.0" @@ -519,7 +519,7 @@ "@babel/plugin-syntax-numeric-separator": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz", - "integrity": "sha1-ubBws+M1cM2f0Hun+pHA3Te5r5c=", + "integrity": "sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -528,7 +528,7 @@ "@babel/plugin-syntax-object-rest-spread": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz", - "integrity": "sha1-YOIl7cvZimQDMqLnLdPmbxr1WHE=", + "integrity": "sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.8.0" @@ -537,7 +537,7 @@ "@babel/plugin-syntax-optional-catch-binding": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz", - "integrity": "sha1-YRGiZbz7Ag6579D9/X0mQCue1sE=", + "integrity": "sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.8.0" @@ -546,7 +546,7 @@ "@babel/plugin-syntax-optional-chaining": { "version": "7.8.3", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz", - "integrity": "sha1-T2nCq5UWfgGAzVM2YT+MV4j31Io=", + "integrity": "sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.8.0" @@ -555,7 +555,7 @@ "@babel/plugin-syntax-top-level-await": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.10.4.tgz", - "integrity": "sha1-S764kXtU/PdoNk4KgfVg4zo+9X0=", + "integrity": "sha512-ni1brg4lXEmWyafKr0ccFWkJG0CeMt4WV1oyeBW6EFObF4oOHclbkj5cARxAPQyAQ2UTuplJyK4nfkXIMMFvsQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -564,7 +564,7 @@ "@babel/plugin-transform-arrow-functions": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.10.4.tgz", - "integrity": "sha1-4ilg135pfHT0HFAdRNc9v4pqZM0=", + "integrity": "sha512-9J/oD1jV0ZCBcgnoFWFq1vJd4msoKb/TCpGNFyyLt0zABdcvgK3aYikZ8HjzB14c26bc7E3Q1yugpwGy2aTPNA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -573,7 +573,7 @@ "@babel/plugin-transform-async-to-generator": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.10.4.tgz", - "integrity": "sha1-QaUBfknrbzzak5KlHu8pQFskWjc=", + "integrity": "sha512-F6nREOan7J5UXTLsDsZG3DXmZSVofr2tGNwfdrVwkDWHfQckbQXnXSPfD7iO+c/2HGqycwyLST3DnZ16n+cBJQ==", "dev": true, "requires": { "@babel/helper-module-imports": "^7.10.4", @@ -584,7 +584,7 @@ "@babel/plugin-transform-block-scoped-functions": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.10.4.tgz", - "integrity": "sha1-GvpZV0T3XkOpGvc7DZmOz+Trwug=", + "integrity": "sha512-WzXDarQXYYfjaV1szJvN3AD7rZgZzC1JtjJZ8dMHUyiK8mxPRahynp14zzNjU3VkPqPsO38CzxiWO1c9ARZ8JA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -593,7 +593,7 @@ "@babel/plugin-transform-block-scoping": { "version": "7.11.1", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.11.1.tgz", - "integrity": "sha1-W37+mIUr741lLAsoFEzZOp5LUhU=", + "integrity": "sha512-00dYeDE0EVEHuuM+26+0w/SCL0BH2Qy7LwHuI4Hi4MH5gkC8/AqMN5uWFJIsoXZrAphiMm1iXzBw6L2T+eA0ew==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -602,7 +602,7 @@ "@babel/plugin-transform-classes": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-classes/-/plugin-transform-classes-7.10.4.tgz", - "integrity": "sha1-QFE2rys+IYvEoZJiKLyRerGgrcc=", + "integrity": "sha512-2oZ9qLjt161dn1ZE0Ms66xBncQH4In8Sqw1YWgBUZuGVJJS5c0OFZXL6dP2MRHrkU/eKhWg8CzFJhRQl50rQxA==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.10.4", @@ -618,7 +618,7 @@ "@babel/plugin-transform-computed-properties": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.10.4.tgz", - "integrity": "sha1-ne2DqBboLe0o1S1LTsvdgQzfwOs=", + "integrity": "sha512-JFwVDXcP/hM/TbyzGq3l/XWGut7p46Z3QvqFMXTfk6/09m7xZHJUN9xHfsv7vqqD4YnfI5ueYdSJtXqqBLyjBw==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -627,7 +627,7 @@ "@babel/plugin-transform-destructuring": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.10.4.tgz", - "integrity": "sha1-cN3Ss9G+qD0BUJ6bsl3bOnT8heU=", + "integrity": "sha512-+WmfvyfsyF603iPa6825mq6Qrb7uLjTOsa3XOFzlYcYDHSS4QmpOWOL0NNBY5qMbvrcf3tq0Cw+v4lxswOBpgA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -636,7 +636,7 @@ "@babel/plugin-transform-dotall-regex": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.10.4.tgz", - "integrity": "sha1-RpwgYhBcHragQOr0+sS0iAeDle4=", + "integrity": "sha512-ZEAVvUTCMlMFAbASYSVQoxIbHm2OkG2MseW6bV2JjIygOjdVv8tuxrCTzj1+Rynh7ODb8GivUy7dzEXzEhuPaA==", "dev": true, "requires": { "@babel/helper-create-regexp-features-plugin": "^7.10.4", @@ -646,7 +646,7 @@ "@babel/plugin-transform-duplicate-keys": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.10.4.tgz", - "integrity": "sha1-aX5Qyf7hQ4D+hD0fMGspVhdDHkc=", + "integrity": "sha512-GL0/fJnmgMclHiBTTWXNlYjYsA7rDrtsazHG6mglaGSTh0KsrW04qml+Bbz9FL0LcJIRwBWL5ZqlNHKTkU3xAA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -655,7 +655,7 @@ "@babel/plugin-transform-exponentiation-operator": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.10.4.tgz", - "integrity": "sha1-WuM4xX+M9AAb2zVgeuZrktZlry4=", + "integrity": "sha512-S5HgLVgkBcRdyQAHbKj+7KyuWx8C6t5oETmUuwz1pt3WTWJhsUV0WIIXuVvfXMxl/QQyHKlSCNNtaIamG8fysw==", "dev": true, "requires": { "@babel/helper-builder-binary-assignment-operator-visitor": "^7.10.4", @@ -665,7 +665,7 @@ "@babel/plugin-transform-for-of": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.10.4.tgz", - "integrity": "sha1-wIiS6IGdOl2ykDGxFa9RHbv+uuk=", + "integrity": "sha512-ItdQfAzu9AlEqmusA/65TqJ79eRcgGmpPPFvBnGILXZH975G0LNjP1yjHvGgfuCxqrPPueXOPe+FsvxmxKiHHQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -674,7 +674,7 @@ "@babel/plugin-transform-function-name": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.10.4.tgz", - "integrity": "sha1-akZ4gOD8ljhRS6NpERgR3b4mRLc=", + "integrity": "sha512-OcDCq2y5+E0dVD5MagT5X+yTRbcvFjDI2ZVAottGH6tzqjx/LKpgkUepu3hp/u4tZBzxxpNGwLsAvGBvQ2mJzg==", "dev": true, "requires": { "@babel/helper-function-name": "^7.10.4", @@ -684,7 +684,7 @@ "@babel/plugin-transform-literals": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-literals/-/plugin-transform-literals-7.10.4.tgz", - "integrity": "sha1-n0K6CEEQChNfInEtDjkcRi9XHzw=", + "integrity": "sha512-Xd/dFSTEVuUWnyZiMu76/InZxLTYilOSr1UlHV+p115Z/Le2Fi1KXkJUYz0b42DfndostYlPub3m8ZTQlMaiqQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -693,7 +693,7 @@ "@babel/plugin-transform-member-expression-literals": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.10.4.tgz", - "integrity": "sha1-sexE/PGVr8uNssYs2OVRyIG6+Lc=", + "integrity": "sha512-0bFOvPyAoTBhtcJLr9VcwZqKmSjFml1iVxvPL0ReomGU53CX53HsM4h2SzckNdkQcHox1bpAqzxBI1Y09LlBSw==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -702,7 +702,7 @@ "@babel/plugin-transform-modules-amd": { "version": "7.10.5", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.10.5.tgz", - "integrity": "sha1-G5zdrwXZ6Is6rTOcs+RFxPAgqbE=", + "integrity": "sha512-elm5uruNio7CTLFItVC/rIzKLfQ17+fX7EVz5W0TMgIHFo1zY0Ozzx+lgwhL4plzl8OzVn6Qasx5DeEFyoNiRw==", "dev": true, "requires": { "@babel/helper-module-transforms": "^7.10.5", @@ -713,7 +713,7 @@ "@babel/plugin-transform-modules-commonjs": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.10.4.tgz", - "integrity": "sha1-ZmZ8Pu2h6/eJbUHx8WsXEFovvKA=", + "integrity": "sha512-Xj7Uq5o80HDLlW64rVfDBhao6OX89HKUmb+9vWYaLXBZOma4gA6tw4Ni1O5qVDoZWUV0fxMYA0aYzOawz0l+1w==", "dev": true, "requires": { "@babel/helper-module-transforms": "^7.10.4", @@ -725,7 +725,7 @@ "@babel/plugin-transform-modules-systemjs": { "version": "7.10.5", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.10.5.tgz", - "integrity": "sha1-YnAJnIVAZmgbrp4F+H4bnK2+jIU=", + "integrity": "sha512-f4RLO/OL14/FP1AEbcsWMzpbUz6tssRaeQg11RH1BP/XnPpRoVwgeYViMFacnkaw4k4wjRSjn3ip1Uw9TaXuMw==", "dev": true, "requires": { "@babel/helper-hoist-variables": "^7.10.4", @@ -737,7 +737,7 @@ "@babel/plugin-transform-modules-umd": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.10.4.tgz", - "integrity": "sha1-moSB/oG4JGVLOgtl2j34nz0hg54=", + "integrity": "sha512-mohW5q3uAEt8T45YT7Qc5ws6mWgJAaL/8BfWD9Dodo1A3RKWli8wTS+WiQ/knF+tXlPirW/1/MqzzGfCExKECA==", "dev": true, "requires": { "@babel/helper-module-transforms": "^7.10.4", @@ -747,7 +747,7 @@ "@babel/plugin-transform-named-capturing-groups-regex": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.10.4.tgz", - "integrity": "sha1-eLTZeIELbzvPA/njGPL8DtQa7LY=", + "integrity": "sha512-V6LuOnD31kTkxQPhKiVYzYC/Jgdq53irJC/xBSmqcNcqFGV+PER4l6rU5SH2Vl7bH9mLDHcc0+l9HUOe4RNGKA==", "dev": true, "requires": { "@babel/helper-create-regexp-features-plugin": "^7.10.4" @@ -756,7 +756,7 @@ "@babel/plugin-transform-new-target": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.10.4.tgz", - "integrity": "sha1-kJfXU8t7Aky3OBo7LlLpUTqcaIg=", + "integrity": "sha512-YXwWUDAH/J6dlfwqlWsztI2Puz1NtUAubXhOPLQ5gjR/qmQ5U96DY4FQO8At33JN4XPBhrjB8I4eMmLROjjLjw==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -765,7 +765,7 @@ "@babel/plugin-transform-object-super": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.10.4.tgz", - "integrity": "sha1-1xRsTROUM+emUm+IjGZ+MUoJOJQ=", + "integrity": "sha512-5iTw0JkdRdJvr7sY0vHqTpnruUpTea32JHmq/atIWqsnNussbRzjEDyWep8UNztt1B5IusBYg8Irb0bLbiEBCQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4", @@ -775,7 +775,7 @@ "@babel/plugin-transform-parameters": { "version": "7.10.5", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.10.5.tgz", - "integrity": "sha1-WdM51Y0LGVBDX0BD504lEABeLEo=", + "integrity": "sha512-xPHwUj5RdFV8l1wuYiu5S9fqWGM2DrYc24TMvUiRrPVm+SM3XeqU9BcokQX/kEUe+p2RBwy+yoiR1w/Blq6ubw==", "dev": true, "requires": { "@babel/helper-get-function-arity": "^7.10.4", @@ -785,7 +785,7 @@ "@babel/plugin-transform-property-literals": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.10.4.tgz", - "integrity": "sha1-9v5UtlkDUimHhbg+3YFdIUxC48A=", + "integrity": "sha512-ofsAcKiUxQ8TY4sScgsGeR2vJIsfrzqvFb9GvJ5UdXDzl+MyYCaBj/FGzXuv7qE0aJcjWMILny1epqelnFlz8g==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -794,7 +794,7 @@ "@babel/plugin-transform-regenerator": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.10.4.tgz", - "integrity": "sha1-IBXlnYOQdOdoON4hWdtCGWb9i2M=", + "integrity": "sha512-3thAHwtor39A7C04XucbMg17RcZ3Qppfxr22wYzZNcVIkPHfpM9J0SO8zuCV6SZa265kxBJSrfKTvDCYqBFXGw==", "dev": true, "requires": { "regenerator-transform": "^0.14.2" @@ -803,7 +803,7 @@ "@babel/plugin-transform-reserved-words": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.10.4.tgz", - "integrity": "sha1-jyaCvNzvntMn4bCGFYXXAT+KVN0=", + "integrity": "sha512-hGsw1O6Rew1fkFbDImZIEqA8GoidwTAilwCyWqLBM9f+e/u/sQMQu7uX6dyokfOayRuuVfKOW4O7HvaBWM+JlQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -812,7 +812,7 @@ "@babel/plugin-transform-shorthand-properties": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.10.4.tgz", - "integrity": "sha1-n9Jexc3VVbt/Rz5ebuHJce7eTdY=", + "integrity": "sha512-AC2K/t7o07KeTIxMoHneyX90v3zkm5cjHJEokrPEAGEy3UCp8sLKfnfOIGdZ194fyN4wfX/zZUWT9trJZ0qc+Q==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -821,7 +821,7 @@ "@babel/plugin-transform-spread": { "version": "7.11.0", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-spread/-/plugin-transform-spread-7.11.0.tgz", - "integrity": "sha1-+oTTAPXk9XdS/kGm0bPFVPE/F8w=", + "integrity": "sha512-UwQYGOqIdQJe4aWNyS7noqAnN2VbaczPLiEtln+zPowRNlD+79w3oi2TWfYe0eZgd+gjZCbsydN7lzWysDt+gw==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4", @@ -831,7 +831,7 @@ "@babel/plugin-transform-sticky-regex": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.10.4.tgz", - "integrity": "sha1-jziJ7oZXWBEwop2cyR18c7fEoo0=", + "integrity": "sha512-Ddy3QZfIbEV0VYcVtFDCjeE4xwVTJWTmUtorAJkn6u/92Z/nWJNV+mILyqHKrUxXYKA2EoCilgoPePymKL4DvQ==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4", @@ -841,7 +841,7 @@ "@babel/plugin-transform-template-literals": { "version": "7.10.5", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.10.5.tgz", - "integrity": "sha1-eLxdYmpmQtszEtnQ8AH152Of3ow=", + "integrity": "sha512-V/lnPGIb+KT12OQikDvgSuesRX14ck5FfJXt6+tXhdkJ+Vsd0lDCVtF6jcB4rNClYFzaB2jusZ+lNISDk2mMMw==", "dev": true, "requires": { "@babel/helper-annotate-as-pure": "^7.10.4", @@ -851,7 +851,7 @@ "@babel/plugin-transform-typeof-symbol": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.10.4.tgz", - "integrity": "sha1-lQnxp+7DHE7b/+E3wWzDP/C8W/w=", + "integrity": "sha512-QqNgYwuuW0y0H+kUE/GWSR45t/ccRhe14Fs/4ZRouNNQsyd4o3PG4OtHiIrepbM2WKUBDAXKCAK/Lk4VhzTaGA==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -860,7 +860,7 @@ "@babel/plugin-transform-unicode-escapes": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.10.4.tgz", - "integrity": "sha1-/q5SM5HHZR3awRXa4KnQaFeJIAc=", + "integrity": "sha512-y5XJ9waMti2J+e7ij20e+aH+fho7Wb7W8rNuu72aKRwCHFqQdhkdU2lo3uZ9tQuboEJcUFayXdARhcxLQ3+6Fg==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.10.4" @@ -869,7 +869,7 @@ "@babel/plugin-transform-unicode-regex": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.10.4.tgz", - "integrity": "sha1-5W1x+SgvrG2wnIJ0IFVXbV5tgKg=", + "integrity": "sha512-wNfsc4s8N2qnIwpO/WP2ZiSyjfpTamT2C9V9FDH/Ljub9zw6P3SjkXcFmc0RQUt96k2fmIvtla2MMjgTwIAC+A==", "dev": true, "requires": { "@babel/helper-create-regexp-features-plugin": "^7.10.4", @@ -877,9 +877,9 @@ } }, "@babel/preset-env": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.11.0.tgz", - "integrity": "sha1-hg7jjyzhetYEgMICG6lok5Pvt5Y=", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/preset-env/-/preset-env-7.11.5.tgz", + "integrity": "sha512-kXqmW1jVcnB2cdueV+fyBM8estd5mlNfaQi6lwLgRwCby4edpavgbFhiBNjmWA3JpB/yZGSISa7Srf+TwxDQoA==", "dev": true, "requires": { "@babel/compat-data": "^7.11.0", @@ -944,7 +944,7 @@ "@babel/plugin-transform-unicode-escapes": "^7.10.4", "@babel/plugin-transform-unicode-regex": "^7.10.4", "@babel/preset-modules": "^0.1.3", - "@babel/types": "^7.11.0", + "@babel/types": "^7.11.5", "browserslist": "^4.12.0", "core-js-compat": "^3.6.2", "invariant": "^2.2.2", @@ -953,9 +953,9 @@ } }, "@babel/preset-modules": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.3.tgz", - "integrity": "sha1-EyQrU7XvjIg8PPfd3VWzbOgPvHI=", + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/@babel/preset-modules/-/preset-modules-0.1.4.tgz", + "integrity": "sha512-J36NhwnfdzpmH41M1DrnkkgAqhZaqr/NBdPfQ677mLzlaXo+oDiv1deyCDtgAhz8p328otdob0Du7+xgHGZbKg==", "dev": true, "requires": { "@babel/helper-plugin-utils": "^7.0.0", @@ -968,7 +968,7 @@ "@babel/runtime": { "version": "7.11.2", "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.11.2.tgz", - "integrity": "sha1-9UnBPHVMxAuHZEufqfCaapX+BzY=", + "integrity": "sha512-TeWkU52so0mPtDcaCTxNBI/IHiz0pZgr8VEFqXFtZWpYD08ZB6FaSwVAS8MKRQAP3bYKiVjwysOJgMFY28o6Tw==", "dev": true, "requires": { "regenerator-runtime": "^0.13.4" @@ -977,7 +977,7 @@ "@babel/template": { "version": "7.10.4", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.10.4.tgz", - "integrity": "sha1-MlGZbEIA68cdGo/EBfupQPNrong=", + "integrity": "sha512-ZCjD27cGJFUB6nmCB1Enki3r+L5kJveX9pq1SvAUKoICy6CZ9yD8xO086YXdYhvNjBdnekm4ZnaP5yC8Cs/1tA==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", @@ -986,26 +986,26 @@ } }, "@babel/traverse": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.0.tgz", - "integrity": "sha1-m5ls4bmPU/fD5BdRFWBdVu0H3SQ=", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.11.5.tgz", + "integrity": "sha512-EjiPXt+r7LiCZXEfRpSJd+jUMnBd4/9OUv7Nx3+0u9+eimMwJmG0Q98lw4/289JCoxSE8OolDMNZaaF/JZ69WQ==", "dev": true, "requires": { "@babel/code-frame": "^7.10.4", - "@babel/generator": "^7.11.0", + "@babel/generator": "^7.11.5", "@babel/helper-function-name": "^7.10.4", "@babel/helper-split-export-declaration": "^7.11.0", - "@babel/parser": "^7.11.0", - "@babel/types": "^7.11.0", + "@babel/parser": "^7.11.5", + "@babel/types": "^7.11.5", "debug": "^4.1.0", "globals": "^11.1.0", "lodash": "^4.17.19" } }, "@babel/types": { - "version": "7.11.0", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.0.tgz", - "integrity": "sha1-Kua/G6mujDxDgk5YYSaYcbIG6Q0=", + "version": "7.11.5", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.11.5.tgz", + "integrity": "sha512-bvM7Qz6eKnJVFIn+1LPtjlBFPVN5jNDc1XmN15vWe7Q3DPBufWWsLiIvUu7xW87uTG6QoggpIDnUgLQvPheU+Q==", "dev": true, "requires": { "@babel/helper-validator-identifier": "^7.10.4", @@ -1013,10 +1013,39 @@ "to-fast-properties": "^2.0.0" } }, + "@eslint/eslintrc": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-0.1.3.tgz", + "integrity": "sha512-4YVwPkANLeNtRjMekzux1ci8hIaH5eGKktGqR0d3LWsKNn5B2X/1Z6Trxy7jQXl9EBGE6Yj02O+t09FMeRllaA==", + "dev": true, + "requires": { + "ajv": "^6.12.4", + "debug": "^4.1.1", + "espree": "^7.3.0", + "globals": "^12.1.0", + "ignore": "^4.0.6", + "import-fresh": "^3.2.1", + "js-yaml": "^3.13.1", + "lodash": "^4.17.19", + "minimatch": "^3.0.4", + "strip-json-comments": "^3.1.1" + }, + "dependencies": { + "globals": { + "version": "12.4.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", + "dev": true, + "requires": { + "type-fest": "^0.8.1" + } + } + } + }, "@istanbuljs/load-nyc-config": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz", - "integrity": "sha1-/T2x1Z7PfPEh6AZQu4ZxL5tV7O0=", + "integrity": "sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ==", "dev": true, "requires": { "camelcase": "^5.3.1", @@ -1029,7 +1058,7 @@ "resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha1-w1IlhD3493bfIcV1V7wIfp39/Gk=", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true } } @@ -1037,7 +1066,7 @@ "@istanbuljs/nyc-config-typescript": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/@istanbuljs/nyc-config-typescript/-/nyc-config-typescript-1.0.1.tgz", - "integrity": "sha1-VRcvVmOzY1WGrdIbFNQsqUoWPVg=", + "integrity": "sha512-/gz6LgVpky205LuoOfwEZmnUtaSmdk0QIMcNFj9OvxhiMhPpKftMgZmGN7jNj7jR+lr8IB1Yks3QSSSNSxfoaQ==", "dev": true, "requires": { "@istanbuljs/schema": "^0.1.2" @@ -1046,19 +1075,19 @@ "@istanbuljs/schema": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/@istanbuljs/schema/-/schema-0.1.2.tgz", - "integrity": "sha1-JlIL8Jq+SlZEzVQU43ElqJVCQd0=", + "integrity": "sha512-tsAQNx32a8CoFhjhijUIhI4kccIAgmGhy8LZMZgGfmXcpMbPRUqn5LWmgRttILi6yeGmBJd2xsPkFMs0PzgPCw==", "dev": true }, "@microsoft/api-extractor": { - "version": "7.9.10", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.9.10.tgz", - "integrity": "sha1-4VZ2yjXFBhlxaXoBesBav5y6aUs=", + "version": "7.9.13", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor/-/api-extractor-7.9.13.tgz", + "integrity": "sha512-hWpNLeHv4zwEn0UBhgSDN3Fn8YVVU8Ti8IMTy6Ik/AC7AEwU6QzGRnH5GSxbkfig+K22dmnwxljyxy6FAkam+g==", "dev": true, "requires": { - "@microsoft/api-extractor-model": "7.8.18", + "@microsoft/api-extractor-model": "7.8.21", "@microsoft/tsdoc": "0.12.19", - "@rushstack/node-core-library": "3.29.1", - "@rushstack/ts-command-line": "4.6.3", + "@rushstack/node-core-library": "3.31.0", + "@rushstack/ts-command-line": "4.6.4", "colors": "~1.2.1", "lodash": "~4.17.15", "resolve": "~1.17.0", @@ -1070,43 +1099,72 @@ "semver": { "version": "7.3.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha1-YElisFK4HtB4aq6EOJ/7pw/9OTg=", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true }, "typescript": { "version": "3.9.7", "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.9.7.tgz", - "integrity": "sha1-mNYApevcOPQMsndSLxLcgA6eJfo=", + "integrity": "sha512-BLbiRkiBzAwsjut4x/dsibSTB6yWpwT5qWmC2OfuCg3GgVQCSgMs4vEctYPhsaGtd0AeuuHMkjZ2h2WG8MSzRw==", "dev": true } } }, "@microsoft/api-extractor-model": { - "version": "7.8.18", - "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.8.18.tgz", - "integrity": "sha1-FaClMha5IaQjiKsp3e4+szwtmZU=", + "version": "7.8.21", + "resolved": "https://registry.npmjs.org/@microsoft/api-extractor-model/-/api-extractor-model-7.8.21.tgz", + "integrity": "sha512-gpg92BaN1mlxvSvyFMTPkcIZOqC9Q5pX/cKqkF+rtH0RXVQXL7ck9LWyM6gSrd/ricz/ARlsyTlLPNq2vJZg7A==", "dev": true, "requires": { "@microsoft/tsdoc": "0.12.19", - "@rushstack/node-core-library": "3.29.1" + "@rushstack/node-core-library": "3.31.0" } }, "@microsoft/tsdoc": { "version": "0.12.19", "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.12.19.tgz", - "integrity": "sha1-IXPMuSRpqvYgMfqUmdIbFtB/m1c=", + "integrity": "sha512-IpgPxHrNxZiMNUSXqR1l/gePKPkfAmIKoDRP9hp7OwjU29ZR8WCJsOJ8iBKgw0Qk+pFwR+8Y1cy8ImLY6e9m4A==", "dev": true }, + "@microsoft/tsdoc-config": { + "version": "0.13.6", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc-config/-/tsdoc-config-0.13.6.tgz", + "integrity": "sha512-VJjV35PnrNISoX2WMemZjnCIdOUPTRpCz6pu8inISotLd3SgoDSJygGaE7+lOYdCtDl+4c8PWJdZivxxXgOnLw==", + "dev": true, + "requires": { + "@microsoft/tsdoc": "0.12.21", + "ajv": "~6.12.3", + "jju": "~1.4.0", + "resolve": "~1.12.0" + }, + "dependencies": { + "@microsoft/tsdoc": { + "version": "0.12.21", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.12.21.tgz", + "integrity": "sha512-j+9OJ0A0buZZaUn6NxeHUVpoa05tY2PgVs7kXJhJQiKRB0G1zQqbJxer3T7jWtzpqQWP89OBDluyIeyTsMk8Sg==", + "dev": true + }, + "resolve": { + "version": "1.12.3", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.12.3.tgz", + "integrity": "sha512-hF6+hAPlxjqHWrw4p1rF3Wztbgxd4AjA5VlUzY5zcTb4J8D3JK4/1RjU48pHz2PJWzGVsLB1VWZkvJzhK2CCOA==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } + } + } + }, "@rollup/plugin-babel": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-babel/-/plugin-babel-5.2.0.tgz", - "integrity": "sha1-uHVW1h7RCLTq+dGLUyOWWt+Nm+4=", + "integrity": "sha512-CPABsajaKjINgBQ3it+yMnfVO3ibsrMBxRzbUOUw2cL1hsZJ7aogU8mgglQm3S2hHJgjnAmxPz0Rq7DVdmHsTw==", "dev": true, "requires": { "@babel/helper-module-imports": "^7.10.4", @@ -1116,7 +1174,7 @@ "@rollup/plugin-commonjs": { "version": "15.0.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-commonjs/-/plugin-commonjs-15.0.0.tgz", - "integrity": "sha1-aQ0VqdVLqCnbk1Vb/5uY/zTghXQ=", + "integrity": "sha512-8uAdikHqVyrT32w1zB9VhW6uGwGjhKgnDNP4pQJsjdnyF4FgCj6/bmv24c7v2CuKhq32CcyCwRzMPEElaKkn0w==", "dev": true, "requires": { "@rollup/pluginutils": "^3.1.0", @@ -1131,7 +1189,7 @@ "estree-walker": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-2.0.1.tgz", - "integrity": "sha1-+OAw+yHO+hg7RLetUWt0dDTno+A=", + "integrity": "sha512-tF0hv+Yi2Ot1cwj9eYHtxC0jB9bmjacjQs6ZBTj82H8JwUywFuc+7E83NWfNMwHXZc11mjfFcVXPe9gEP4B8dg==", "dev": true } } @@ -1139,7 +1197,7 @@ "@rollup/plugin-json": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-json/-/plugin-json-4.1.0.tgz", - "integrity": "sha1-VOCYZ65pY8WThE2L16nHGClElvM=", + "integrity": "sha512-yfLbTdNS6amI/2OpmbiBoW12vngr5NW2jCJVZSBEz+H5KfUJZ2M7sDjk0U6GOOdCWFVScShte29o9NezJ53TPw==", "dev": true, "requires": { "@rollup/pluginutils": "^3.0.8" @@ -1148,7 +1206,7 @@ "@rollup/plugin-node-resolve": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/@rollup/plugin-node-resolve/-/plugin-node-resolve-9.0.0.tgz", - "integrity": "sha1-Ob0ANM6RJrOcFplpX0QLS30rYuY=", + "integrity": "sha512-gPz+utFHLRrd41WMP13Jq5mqqzHL3OXrfj3/MkSyB6UBIcuNt9j60GCbarzMzdf1VHFpOxfQh/ez7wyadLMqkg==", "dev": true, "requires": { "@rollup/pluginutils": "^3.1.0", @@ -1162,7 +1220,7 @@ "@rollup/pluginutils": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/@rollup/pluginutils/-/pluginutils-3.1.0.tgz", - "integrity": "sha1-cGtFJO5tyLEDs8mVUz5a1oDAK5s=", + "integrity": "sha512-GksZ6pr6TpIjHm8h9lSQ8pi8BE9VeubNT0OMJ3B5uZJ8pz73NPiqOtCog/x2/QzM1ENChPKxMDhiQuRHsqc+lg==", "dev": true, "requires": { "@types/estree": "0.0.39", @@ -1171,9 +1229,9 @@ } }, "@rushstack/node-core-library": { - "version": "3.29.1", - "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.29.1.tgz", - "integrity": "sha1-mdJGs+BXO3ii+WaTVrKdcOPiV3M=", + "version": "3.31.0", + "resolved": "https://registry.npmjs.org/@rushstack/node-core-library/-/node-core-library-3.31.0.tgz", + "integrity": "sha512-GN/nKEszlKvW4Efhmicbk/s+mY6cshXexINl+W1OBtq2AaTae1QI0XjGjCp6cCygW7PltilJ5EOKGEtTQg2mew==", "dev": true, "requires": { "@types/node": "10.17.13", @@ -1181,6 +1239,7 @@ "fs-extra": "~7.0.1", "import-lazy": "~4.0.0", "jju": "~1.4.0", + "resolve": "~1.17.0", "semver": "~7.3.0", "timsort": "~0.3.0", "z-schema": "~3.18.3" @@ -1189,15 +1248,15 @@ "semver": { "version": "7.3.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha1-YElisFK4HtB4aq6EOJ/7pw/9OTg=", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true } } }, "@rushstack/ts-command-line": { - "version": "4.6.3", - "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.6.3.tgz", - "integrity": "sha1-DEITo0Dm5WqakQ+WLi228GHPgeI=", + "version": "4.6.4", + "resolved": "https://registry.npmjs.org/@rushstack/ts-command-line/-/ts-command-line-4.6.4.tgz", + "integrity": "sha512-ubIANZimyU07+ChU56LfiD36NJ8gvw1txlvUP20GYNQi4lf5N0xEnev4r+AtKkOdnowpGy60ObGmYxSUpSacpw==", "dev": true, "requires": { "@types/argparse": "1.0.38", @@ -1209,31 +1268,31 @@ "@types/argparse": { "version": "1.0.38", "resolved": "https://registry.npmjs.org/@types/argparse/-/argparse-1.0.38.tgz", - "integrity": "sha1-qB/YYG1IH4c6OADG665PHXaKVqk=", + "integrity": "sha512-ebDJ9b0e702Yr7pWgB0jzm+CX4Srzz8RcXtLJDJB+BSccqMa36uyH/zUsSYao5+BD1ytv3k3rPYCq4mAE1hsXA==", "dev": true }, "@types/color-name": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/@types/color-name/-/color-name-1.1.1.tgz", - "integrity": "sha1-HBJhu+qhCoBVu8XYq4S3sq/IRqA=", + "integrity": "sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ==", "dev": true }, "@types/eslint-visitor-keys": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/@types/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", - "integrity": "sha1-HuMNeVRMqE1o1LPNsK9PIFZj3S0=", + "integrity": "sha512-OCutwjDZ4aFS6PB1UZ988C4YgwlBHJd6wCeQqaLdmadZ/7e+w79+hbMUFC1QXDNCmdyoRfAFdm0RypzwR+Qpag==", "dev": true }, "@types/estree": { "version": "0.0.39", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", - "integrity": "sha1-4Xfmme4bjCLSMXTKqnQiZEOJUJ8=", + "integrity": "sha512-EYNwp3bU+98cpU4lAWYYL7Zz+2gryWH1qbdDTidVd6hkiR6weksdbMadyXKXNPEkQFhXM+hVO9ZygomHXp+AIw==", "dev": true }, "@types/json-schema": { - "version": "7.0.5", - "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.5.tgz", - "integrity": "sha1-3M5EMOZLRDuolF8CkPtWStW6xt0=", + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.6.tgz", + "integrity": "sha512-3c+yGKvVP5Y9TYBEibGNR+kLtijnj7mYrXRg+WpFb2X9xm04g/DXYkfg4hmzJQosc9snFNUPkbYIhu+KAm6jJw==", "dev": true }, "@types/minimist": { @@ -1245,19 +1304,19 @@ "@types/node": { "version": "10.17.13", "resolved": "https://registry.npmjs.org/@types/node/-/node-10.17.13.tgz", - "integrity": "sha1-zOvNuZC9YTnNFuhMOdwvsQI8qQw=", + "integrity": "sha512-pMCcqU2zT4TjqYFrWtYHKal7Sl30Ims6ulZ4UFXxI4xbtQqK/qqKwkDoBFCfooRqqmRu9vY3xaJRwxSh673aYg==", "dev": true }, "@types/normalize-package-data": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/@types/normalize-package-data/-/normalize-package-data-2.4.0.tgz", - "integrity": "sha1-5IbQ2XOW15vu3QpuM/RTT/a0lz4=", + "integrity": "sha512-f5j5b/Gf71L+dbqxIpQ4Z2WlmI/mPJ0fOkGGmFgtb6sAu97EPczzbS3/tJKxmcYDj55OX6ssqwDAWOHIYDRDGA==", "dev": true }, "@types/resolve": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/@types/resolve/-/resolve-1.17.1.tgz", - "integrity": "sha1-Ov1q2JZ8d+Q3bFmKgt3Vj0bsRdY=", + "integrity": "sha512-yy7HuzQhj0dhGpD8RLXSZWEkLsV9ibvxvi6EiJ3bkqLAO1RGo0WbkWQiwpRlSFymTJRz0d3k5LM3kkx8ArDbLw==", "dev": true, "requires": { "@types/node": "*" @@ -1266,7 +1325,7 @@ "@typescript-eslint/eslint-plugin": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-3.10.1.tgz", - "integrity": "sha1-fgYTOKE4P1ntwgTGBYmfk9wuLI8=", + "integrity": "sha512-PQg0emRtzZFWq6PxBcdxRH3QIQiyFO3WCVpRL3fgj5oQS3CDs3AeAKfv4DxNhzn8ITdNJGJ4D3Qw8eAJf3lXeQ==", "dev": true, "requires": { "@typescript-eslint/experimental-utils": "3.10.1", @@ -1280,7 +1339,7 @@ "semver": { "version": "7.3.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha1-YElisFK4HtB4aq6EOJ/7pw/9OTg=", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true } } @@ -1288,7 +1347,7 @@ "@typescript-eslint/experimental-utils": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-3.10.1.tgz", - "integrity": "sha1-4Xn/yBqA68ri6gTgMy+LJRNFpoY=", + "integrity": "sha512-DewqIgscDzmAfd5nOGe4zm6Bl7PKtMG2Ad0KG8CUZAHlXfAKTF9Ol5PXhiMh39yRL2ChRH1cuuUGOcVyyrhQIw==", "dev": true, "requires": { "@types/json-schema": "^7.0.3", @@ -1301,7 +1360,7 @@ "@typescript-eslint/parser": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-3.10.1.tgz", - "integrity": "sha1-GIOFjoPotEJifhrG9AiSUhEVVGc=", + "integrity": "sha512-Ug1RcWcrJP02hmtaXVS3axPPTTPnZjupqhgj+NnZ6BCkwSImWk/283347+x9wN+lqOdK9Eo3vsyiyDHgsmiEJw==", "dev": true, "requires": { "@types/eslint-visitor-keys": "^1.0.0", @@ -1314,13 +1373,13 @@ "@typescript-eslint/types": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-3.10.1.tgz", - "integrity": "sha1-HXRj+nwy2KI6tQioA8ov4m51hyc=", + "integrity": "sha512-+3+FCUJIahE9q0lDi1WleYzjCwJs5hIsbugIgnbB+dSCYUxl8L6PwmsyOPFZde2hc1DlTo/xnkOgiTLSyAbHiQ==", "dev": true }, "@typescript-eslint/typescript-estree": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-3.10.1.tgz", - "integrity": "sha1-/QBhzDit1PrUUTbWVECFafNluFM=", + "integrity": "sha512-QbcXOuq6WYvnB3XPsZpIwztBoquEYLXh2MtwVU+kO8jgYCiv4G5xrSP/1wg4tkvrEE+esZVquIPX/dxPlePk1w==", "dev": true, "requires": { "@typescript-eslint/types": "3.10.1", @@ -1336,7 +1395,7 @@ "semver": { "version": "7.3.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha1-YElisFK4HtB4aq6EOJ/7pw/9OTg=", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true } } @@ -1344,7 +1403,7 @@ "@typescript-eslint/visitor-keys": { "version": "3.10.1", "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-3.10.1.tgz", - "integrity": "sha1-zUJ0dz4+tjsuhwrGAidEh+zR6TE=", + "integrity": "sha512-9JgC82AaQeglebjZMgYR5wgmfUdUc+EitGUUMW8u2nDckaeimzW+VsoLV6FoimPv2id3VQzfjwBxEMVz08ameQ==", "dev": true, "requires": { "eslint-visitor-keys": "^1.1.0" @@ -1353,7 +1412,7 @@ "JSONStream": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.5.tgz", - "integrity": "sha1-MgjB8I06TZkmGrZPkjArwV4RHKA=", + "integrity": "sha512-E+iruNOY8VV9s4JEbe1aNEm6MiszPRr/UfcHMz0TQh1BXSxHK+ASV1R6W4HpjBhSeS+54PIsAMCBmwD06LLsqQ==", "dev": true, "requires": { "jsonparse": "^1.2.0", @@ -1363,7 +1422,7 @@ "accepts": { "version": "1.3.7", "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.7.tgz", - "integrity": "sha1-UxvHJlF6OytB+FACHGzBXqq1B80=", + "integrity": "sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA==", "dev": true, "requires": { "mime-types": "~2.1.24", @@ -1373,13 +1432,13 @@ "acorn": { "version": "7.4.0", "resolved": "https://registry.npmjs.org/acorn/-/acorn-7.4.0.tgz", - "integrity": "sha1-4a1IbmxUUBY0xsOXxcEh2qODYHw=", + "integrity": "sha512-+G7P8jJmCHr+S+cLfQxygbWhXy+8YTVGzAkpEbcLo2mLoL7tij/VG41QSHACSf5QgYRhMZYHuNc6drJaO0Da+w==", "dev": true }, "acorn-jsx": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.2.0.tgz", - "integrity": "sha1-TGYGkXPW/daO2FI5/CViJhgrLr4=", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.3.1.tgz", + "integrity": "sha512-K0Ptm/47OKfQRpNQ2J/oIN/3QYiK6FwW+eJbILhsdxh2WTLdl+30o8aGdTbm5JbffpFFAg/g+zi1E+jvJha5ng==", "dev": true }, "add-stream": { @@ -1397,7 +1456,7 @@ "aggregate-error": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", - "integrity": "sha1-kmcP9Q9TWb23o+DUDQ7DDFc3aHo=", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", "dev": true, "requires": { "clean-stack": "^2.0.0", @@ -1407,7 +1466,7 @@ "ajv": { "version": "6.12.4", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.4.tgz", - "integrity": "sha1-BhT6zEUiEn+nE0Rca/0+vTduIjQ=", + "integrity": "sha512-eienB2c9qVQs2KWexhkrdMLVDoIQCz5KSeLxwg9Lzk4DOfBtIK9PQwwufcsn1jjGuf9WZmqPMbGxOzfcuphJCQ==", "dev": true, "requires": { "fast-deep-equal": "^3.1.1", @@ -1419,19 +1478,19 @@ "ansi-colors": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", - "integrity": "sha1-y7muJWv3UK8eqzRPIpqif+lLo0g=", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true }, "ansi-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha1-OIU59VF5vzkznIGvMKZU1p+Hy3U=", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", "dev": true }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", - "integrity": "sha1-QfuyAkPlCxK+DwS43tvwdSDOhB0=", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { "color-convert": "^1.9.0" @@ -1440,7 +1499,7 @@ "anymatch": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", - "integrity": "sha1-xV7PAhheJGklk5kxDBc84xIzsUI=", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", "dev": true, "requires": { "normalize-path": "^3.0.0", @@ -1450,7 +1509,7 @@ "append-transform": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-2.0.0.tgz", - "integrity": "sha1-mdnSnHs4OR5vQo0ozhNlUfC3fhI=", + "integrity": "sha512-7yeyCEurROLQJFv5Xj4lEGTy0borxepjFv1g22oAdqFu//SrAlDl1O1Nxx15SH1RoliUml6p8dwJW9jvZughhg==", "dev": true, "requires": { "default-require-extensions": "^3.0.0" @@ -1465,13 +1524,13 @@ "arg": { "version": "4.1.3", "resolved": "https://registry.npmjs.org/arg/-/arg-4.1.3.tgz", - "integrity": "sha1-Jp/HrVuOQstjyJbVZmAXJhwUQIk=", + "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", - "integrity": "sha1-vNZ5HqWuCXJeF+WtmIE0zUCz2RE=", + "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { "sprintf-js": "~1.0.2" @@ -1492,7 +1551,7 @@ "arraybuffer.slice": { "version": "0.0.7", "resolved": "https://registry.npmjs.org/arraybuffer.slice/-/arraybuffer.slice-0.0.7.tgz", - "integrity": "sha1-O7xCdd1YTMGxCAm4nU6LY6aednU=", + "integrity": "sha512-wGUIVQXuehL5TCqQun8OW81jGzAWycqzFF8lFp+GOM5BXLYj3bKNsYC4daB7n6XjCqxQA/qgTJ+8ANR3acjrog==", "dev": true }, "arrify": { @@ -1504,19 +1563,19 @@ "assertion-error": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha1-5gtrDo8wG9l+U3UhW9pAbIURjAs=", + "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, "astral-regex": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", - "integrity": "sha1-bIw/uCfdQ+45GPJ7gngqt2WKb9k=", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", "dev": true }, "async-limiter": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", - "integrity": "sha1-3TeelPDbgxCwgpH51kwyCXZmF/0=", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", "dev": true }, "at-least-node": { @@ -1528,7 +1587,7 @@ "babel-plugin-dynamic-import-node": { "version": "2.3.3", "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.3.tgz", - "integrity": "sha1-hP2hnJduxcbe/vV/lCez3vZuF6M=", + "integrity": "sha512-jZVI+s9Zg3IqA/kdi0i6UDCybUI3aSBLnglhYbSSjKlV7yF1F/5LWv8MakQmvYpnbJDS6fcBL2KzHSxNCMtWSQ==", "dev": true, "requires": { "object.assign": "^4.1.0" @@ -1555,12 +1614,12 @@ "base64-js": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.3.1.tgz", - "integrity": "sha1-WOzoy3XdB+ce0IxzarxfrE2/jfE=" + "integrity": "sha512-mLQ4i2QO1ytvGWFWmcngKO//JXAQueZvwEKtjgQFM4jIK0kU+ytMfplL8j+n5mspOfjHwoAg+9yhb7BwAHm36g==" }, "base64id": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/base64id/-/base64id-2.0.0.tgz", - "integrity": "sha1-J3Csa8R9MSr5eov5pjQ0LgzSXLY=", + "integrity": "sha512-lGe34o6EHj9y3Kts9R4ZYs/Gr+6N7MCaMlIFA3F1R2O5/m7K06AxfSeO5530PEERE6/WyEg3lsuyw4GHlPZHog==", "dev": true }, "benchmark": { @@ -1585,19 +1644,19 @@ "binary-extensions": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.1.0.tgz", - "integrity": "sha1-MPpAyef+B9vIlWeM0ocCTeokHdk=", + "integrity": "sha512-1Yj8h9Q+QDF5FzhMs/c9+6UntbD5MkRfRwac8DoEm9ZfUBZ7tZ55YcGVAzEe4bXsdQHEk+s9S5wsOKVdZrw0tQ==", "dev": true }, "blob": { "version": "0.0.5", "resolved": "https://registry.npmjs.org/blob/-/blob-0.0.5.tgz", - "integrity": "sha1-1oDu7yX4zZGtUz9bAe7UjmTK9oM=", + "integrity": "sha512-gaqbzQPqOoamawKg0LGVd7SzLgXS+JH61oWprSLH+P+abTczqJbhTR8CmJ2u9/bUYNmHTGJx/UEmn6doAvvuig==", "dev": true }, "body-parser": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", - "integrity": "sha1-lrJwnlfJxOCab9Zqj9l5hE9p8Io=", + "integrity": "sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw==", "dev": true, "requires": { "bytes": "3.1.0", @@ -1615,7 +1674,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" @@ -1632,7 +1691,7 @@ "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", - "integrity": "sha1-PH/L9SnYcibz0vUrlm/1Jx60Qd0=", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { "balanced-match": "^1.0.0", @@ -1642,7 +1701,7 @@ "braces": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", - "integrity": "sha1-NFThpGLujVmeI23zNs2epPiv4Qc=", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", "dev": true, "requires": { "fill-range": "^7.0.1" @@ -1651,17 +1710,17 @@ "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha1-uqVZ7hTO1zRSIputcyZGfGH6vWA=", + "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, "browserslist": { - "version": "4.14.0", - "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.0.tgz", - "integrity": "sha1-KQiVGr/k7Jhze3LzTDvO3I1DsAA=", + "version": "4.14.1", + "resolved": "https://registry.npmjs.org/browserslist/-/browserslist-4.14.1.tgz", + "integrity": "sha512-zyBTIHydW37pnb63c7fHFXUG6EcqWOqoMdDx6cdyaDFriZ20EoVxcE95S54N+heRqY8m8IUgB5zYta/gCwSaaA==", "dev": true, "requires": { - "caniuse-lite": "^1.0.30001111", - "electron-to-chromium": "^1.3.523", + "caniuse-lite": "^1.0.30001124", + "electron-to-chromium": "^1.3.562", "escalade": "^3.0.2", "node-releases": "^1.1.60" } @@ -1669,7 +1728,7 @@ "buffer": { "version": "5.6.0", "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.6.0.tgz", - "integrity": "sha1-oxdJ3H2B2E2wir+Te2uMQDP2J4Y=", + "integrity": "sha512-/gDYp/UtU0eA1ys8bOs9J6a+E/KWIY+DZ+Q2WESNUA0jFRsJOc0SNUO6xJ5SGA1xueg3NL65W6s+NY5l9cunuw==", "requires": { "base64-js": "^1.0.2", "ieee754": "^1.1.4" @@ -1684,25 +1743,25 @@ "buffer-from": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", - "integrity": "sha1-MnE7wCj3XAL9txDXx7zsHyxgcO8=", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", "dev": true }, "builtin-modules": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/builtin-modules/-/builtin-modules-3.1.0.tgz", - "integrity": "sha1-qtl8FRMet2tltQ7yCOdYTNdqdIQ=", + "integrity": "sha512-k0KL0aWZuBt2lrxrcASWDfwOLMnodeQjodT/1SxEQAXsHANgo6ZC/VEaSEHCXt7aSTZ4/4H5LKa+tBXmW7Vtvw==", "dev": true }, "bytes": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.0.tgz", - "integrity": "sha1-9s95M6Ng4FiPqf3oVlHNx/gF0fY=", + "integrity": "sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg==", "dev": true }, "caching-transform": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/caching-transform/-/caching-transform-4.0.0.tgz", - "integrity": "sha1-ANKXpCBtceIWPDnq/6gVesBlHw8=", + "integrity": "sha512-kpqOvwXnjjN44D89K5ccQC+RUrsy7jB/XLlRrx0D7/2HNcTPqzsb6XgYoErwko6QsV184CA2YgS1fxDiiDZMWA==", "dev": true, "requires": { "hasha": "^5.0.0", @@ -1720,19 +1779,19 @@ "callsites": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", - "integrity": "sha1-s2MKvYlDQy9Us/BRkjjjPNffL3M=", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, "camelcase": { "version": "5.3.1", "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", - "integrity": "sha1-48mzFWnhBoEd8kL3FXJaH0xJQyA=", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, "camelcase-keys": { "version": "6.2.2", "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-6.2.2.tgz", - "integrity": "sha1-XnVda6UaoiPsfT1S8ld4IQ+dw8A=", + "integrity": "sha512-YrwaA0vEKazPBkn0ipTiMpSajYDSe+KjQfrjhcBMxJt/znbvlHd8Pw/Vamaz5EB4Wfhs3SUR3Z9mwRu/P3s3Yg==", "dev": true, "requires": { "camelcase": "^5.3.1", @@ -1741,15 +1800,15 @@ } }, "caniuse-lite": { - "version": "1.0.30001118", - "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001118.tgz", - "integrity": "sha1-EWqaZw5SZK7IlSB/XpGBKRdMb2I=", + "version": "1.0.30001124", + "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001124.tgz", + "integrity": "sha512-zQW8V3CdND7GHRH6rxm6s59Ww4g/qGWTheoboW9nfeMg7sUoopIfKCcNZUjwYRCOrvereh3kwDpZj4VLQ7zGtA==", "dev": true }, "chai": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/chai/-/chai-4.2.0.tgz", - "integrity": "sha1-dgqnLPION5XoSxKHfODoNzeqKeU=", + "integrity": "sha512-XQU3bhBukrOsQCuwZndwGcCVQHyZi53fQ6Ys1Fym7E4olpIqqZZhhoFJoaKVvV17lWQoXYwgWN2nF5crA8J2jw==", "dev": true, "requires": { "assertion-error": "^1.1.0", @@ -1763,7 +1822,7 @@ "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha1-zUJUFnelQzPPVBpJEIwUMrRMlCQ=", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { "ansi-styles": "^3.2.1", @@ -1780,7 +1839,7 @@ "chokidar": { "version": "3.4.2", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.4.2.tgz", - "integrity": "sha1-ONyOZY3sOAl0HrPve7Ckf+QkIy0=", + "integrity": "sha512-IZHaDeBeI+sZJRX7lGcXsdzgvZqKv6sECqsbErJA4mHWfpRrD8B97kSFN4cQz6nGBGiuFia1MKR4d6c1o8Cv7A==", "dev": true, "requires": { "anymatch": "~3.1.1", @@ -1796,13 +1855,13 @@ "clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", - "integrity": "sha1-7oRy27Ep5yezHooQpCfe6d/kAIs=", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", "dev": true }, "cliui": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/cliui/-/cliui-6.0.0.tgz", - "integrity": "sha1-UR1wLAxOQcoVbX0OlgIfI+EyJbE=", + "integrity": "sha512-t6wbgtoCXvAzst7QgXxJYqPt0usEfbgQdftEPbLL/cvv6HPE5VgvqCuAIDR0NgU52ds6rFwqrgakNLrHEjCbrQ==", "dev": true, "requires": { "string-width": "^4.2.0", @@ -1813,19 +1872,19 @@ "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha1-6Bj9ac5cz8tARZT4QpY79TFkzDc=", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha1-8Rb4Bk/pCz94RKOJl8C3UFEmnx0=", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha1-lSGCxGzHssMT0VluYjmSvRY7crU=", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { "emoji-regex": "^8.0.0", @@ -1838,7 +1897,7 @@ "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", - "integrity": "sha1-u3GFBpDh8TZWfeYp0tVHHe2kweg=", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { "color-name": "1.1.3" @@ -1853,13 +1912,13 @@ "colors": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/colors/-/colors-1.2.5.tgz", - "integrity": "sha1-icetmjdLwDDfgBMkH2gTbtiDWvw=", + "integrity": "sha512-erNRLao/Y3Fv54qUa0LBB+//Uf3YwMUmdJinN20yMXm9zdKKqH9wt7R9IIVZ+K7ShzfpLV/Zg8+VyrBJYB4lpg==", "dev": true }, "commander": { "version": "2.20.3", "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.3.tgz", - "integrity": "sha1-/UhehMA+tIgcIHIrpIA16FMa6zM=", + "integrity": "sha512-GpVkmM8vF2vQUkj2LvZmD35JxeJOLCwJ9cUkugyk2nuhbv3+mJvpLYYt+0+USMxE+oj+ey/lJEnhZw75x/OMcQ==", "dev": true, "optional": true }, @@ -1872,7 +1931,7 @@ "compare-func": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-2.0.0.tgz", - "integrity": "sha1-+2XnXtvd/S5WhVTotbBf/3pR/LM=", + "integrity": "sha512-zHig5N+tPWARooBnb0Zx1MFcdfpyJrfTJ3Y5L+IFvUm8rM74hHz66z0gw0x4tijh5CorKkKUCnW82R2vmpeCRA==", "dev": true, "requires": { "array-ify": "^1.0.0", @@ -1906,7 +1965,7 @@ "concat-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", - "integrity": "sha1-QUz1r3kKSMYKub5FJ9VtXkETPLE=", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -1918,7 +1977,7 @@ "connect": { "version": "3.7.0", "resolved": "https://registry.npmjs.org/connect/-/connect-3.7.0.tgz", - "integrity": "sha1-XUk0iRDKpeB6AYALAw0MNfIEhPg=", + "integrity": "sha512-ZqRXc+tZukToSNmh5C2iWMSoV3X1YUcPbqEM4DkEG5tNQXrQUZCNVGGv3IuicnkMtPfGf3Xtp8WCXs295iQ1pQ==", "dev": true, "requires": { "debug": "2.6.9", @@ -1930,7 +1989,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" @@ -1947,13 +2006,13 @@ "content-type": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.4.tgz", - "integrity": "sha1-4TjMdeBAxyexlm/l5fjJruJW/js=", + "integrity": "sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA==", "dev": true }, "conventional-changelog": { "version": "3.1.21", "resolved": "https://registry.npmjs.org/conventional-changelog/-/conventional-changelog-3.1.21.tgz", - "integrity": "sha1-SndOa/UDrP1+RoW7dQ2owOzPHg0=", + "integrity": "sha512-ZGecVZPEo3aC75VVE4nu85589dDhpMyqfqgUM5Myq6wfKWiNqhDJLSDMsc8qKXshZoY7dqs1hR0H/15kI/G2jQ==", "dev": true, "requires": { "conventional-changelog-angular": "^5.0.10", @@ -1972,7 +2031,7 @@ "conventional-changelog-angular": { "version": "5.0.11", "resolved": "https://registry.npmjs.org/conventional-changelog-angular/-/conventional-changelog-angular-5.0.11.tgz", - "integrity": "sha1-maPKFuSlMF4MLC+uPvdP12Mfw/s=", + "integrity": "sha512-nSLypht/1yEflhuTogC03i7DX7sOrXGsRn14g131Potqi6cbGbGEE9PSDEHKldabB6N76HiSyw9Ph+kLmC04Qw==", "dev": true, "requires": { "compare-func": "^2.0.0", @@ -1982,7 +2041,7 @@ "conventional-changelog-atom": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/conventional-changelog-atom/-/conventional-changelog-atom-2.0.7.tgz", - "integrity": "sha1-IhV1JToE93ov0nPrK/KaE49xCr8=", + "integrity": "sha512-7dOREZwzB+tCEMjRTDfen0OHwd7vPUdmU0llTy1eloZgtOP4iSLVzYIQqfmdRZEty+3w5Jz+AbhfTJKoKw1JeQ==", "dev": true, "requires": { "q": "^1.5.1" @@ -1991,7 +2050,7 @@ "conventional-changelog-codemirror": { "version": "2.0.7", "resolved": "https://registry.npmjs.org/conventional-changelog-codemirror/-/conventional-changelog-codemirror-2.0.7.tgz", - "integrity": "sha1-1raozicHcQxaA24wUDdUf7nhW/s=", + "integrity": "sha512-Oralk1kiagn3Gb5cR5BffenWjVu59t/viE6UMD/mQa1hISMPkMYhJIqX+CMeA1zXgVBO+YHQhhokEj99GP5xcg==", "dev": true, "requires": { "q": "^1.5.1" @@ -2000,13 +2059,13 @@ "conventional-changelog-config-spec": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/conventional-changelog-config-spec/-/conventional-changelog-config-spec-2.1.0.tgz", - "integrity": "sha1-h0pjUofvi1gf2FWFMr9lXU+1ny0=", + "integrity": "sha512-IpVePh16EbbB02V+UA+HQnnPIohgXvJRxHcS5+Uwk4AT5LjzCZJm5sp/yqs5C6KZJ1jMsV4paEV13BN1pvDuxQ==", "dev": true }, "conventional-changelog-conventionalcommits": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/conventional-changelog-conventionalcommits/-/conventional-changelog-conventionalcommits-4.3.0.tgz", - "integrity": "sha1-xCBaZZ98qdeIHynueKTn1q64s8I=", + "integrity": "sha512-oYHydvZKU+bS8LnGqTMlNrrd7769EsuEHKy4fh1oMdvvDi7fem8U+nvfresJ1IDB8K00Mn4LpiA/lR+7Gs6rgg==", "dev": true, "requires": { "compare-func": "^1.3.1", @@ -2017,7 +2076,7 @@ "compare-func": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/compare-func/-/compare-func-1.3.4.tgz", - "integrity": "sha1-awfExeg0ERm69EV4CFvaD0qCNRY=", + "integrity": "sha512-sq2sWtrqKPkEXAC8tEJA1+BqAH9GbFkGBtUOqrUX57VSfwp8xyktctk+uLoRy5eccTdxzDcVIztlYDpKs3Jv1Q==", "dev": true, "requires": { "array-ify": "^1.0.0", @@ -2044,7 +2103,7 @@ "conventional-changelog-core": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/conventional-changelog-core/-/conventional-changelog-core-4.2.0.tgz", - "integrity": "sha1-2L79Hh9RJr81oXZoJ2zIwkRlBGk=", + "integrity": "sha512-8+xMvN6JvdDtPbGBqA7oRNyZD4od1h/SIzrWqHcKZjitbVXrFpozEeyn4iI4af1UwdrabQpiZMaV07fPUTGd4w==", "dev": true, "requires": { "add-stream": "^1.0.0", @@ -2067,7 +2126,7 @@ "conventional-changelog-ember": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/conventional-changelog-ember/-/conventional-changelog-ember-2.0.8.tgz", - "integrity": "sha1-8PBOt/88iFr5fbEAhlq5Xc+pkX8=", + "integrity": "sha512-JEMEcUAMg4Q9yxD341OgWlESQ4gLqMWMXIWWUqoQU8yvTJlKnrvcui3wk9JvnZQyONwM2g1MKRZuAjKxr8hAXA==", "dev": true, "requires": { "q": "^1.5.1" @@ -2076,7 +2135,7 @@ "conventional-changelog-eslint": { "version": "3.0.8", "resolved": "https://registry.npmjs.org/conventional-changelog-eslint/-/conventional-changelog-eslint-3.0.8.tgz", - "integrity": "sha1-+LlSt+1yU+oKwLMHILs4H0khtGw=", + "integrity": "sha512-5rTRltgWG7TpU1PqgKHMA/2ivjhrB+E+S7OCTvj0zM/QGg4vmnVH67Vq/EzvSNYtejhWC+OwzvDrLk3tqPry8A==", "dev": true, "requires": { "q": "^1.5.1" @@ -2085,7 +2144,7 @@ "conventional-changelog-express": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/conventional-changelog-express/-/conventional-changelog-express-2.0.5.tgz", - "integrity": "sha1-bpNwWs2tN0UWyhJZkAEqSOcQ+N4=", + "integrity": "sha512-pW2hsjKG+xNx/Qjof8wYlAX/P61hT5gQ/2rZ2NsTpG+PgV7Rc8RCfITvC/zN9K8fj0QmV6dWmUefCteD9baEAw==", "dev": true, "requires": { "q": "^1.5.1" @@ -2094,7 +2153,7 @@ "conventional-changelog-jquery": { "version": "3.0.10", "resolved": "https://registry.npmjs.org/conventional-changelog-jquery/-/conventional-changelog-jquery-3.0.10.tgz", - "integrity": "sha1-/o62r/MiqpgK9etoSXYipfYlfOc=", + "integrity": "sha512-QCW6wF8QgPkq2ruPaxc83jZxoWQxLkt/pNxIDn/oYjMiVgrtqNdd7lWe3vsl0hw5ENHNf/ejXuzDHk6suKsRpg==", "dev": true, "requires": { "q": "^1.5.1" @@ -2103,7 +2162,7 @@ "conventional-changelog-jshint": { "version": "2.0.8", "resolved": "https://registry.npmjs.org/conventional-changelog-jshint/-/conventional-changelog-jshint-2.0.8.tgz", - "integrity": "sha1-P/9N+MtGA393udw/jjVMf5kzLxM=", + "integrity": "sha512-hB/iI0IiZwnZ+seYI+qEQ4b+EMQSEC8jGIvhO2Vpz1E5p8FgLz75OX8oB1xJWl+s4xBMB6f8zJr0tC/BL7YOjw==", "dev": true, "requires": { "compare-func": "^2.0.0", @@ -2113,13 +2172,13 @@ "conventional-changelog-preset-loader": { "version": "2.3.4", "resolved": "https://registry.npmjs.org/conventional-changelog-preset-loader/-/conventional-changelog-preset-loader-2.3.4.tgz", - "integrity": "sha1-FKhVq7/9WQJ/1gJYHx802YYupEw=", + "integrity": "sha512-GEKRWkrSAZeTq5+YjUZOYxdHq+ci4dNwHvpaBC3+ENalzFWuCWa9EZXSuZBpkr72sMdKB+1fyDV4takK1Lf58g==", "dev": true }, "conventional-changelog-writer": { "version": "4.0.17", "resolved": "https://registry.npmjs.org/conventional-changelog-writer/-/conventional-changelog-writer-4.0.17.tgz", - "integrity": "sha1-R1OqoTi/WqWcCydMtZN+/NJyLiE=", + "integrity": "sha512-IKQuK3bib/n032KWaSb8YlBFds+aLmzENtnKtxJy3+HqDq5kohu3g/UdNbIHeJWygfnEbZjnCKFxAW0y7ArZAw==", "dev": true, "requires": { "compare-func": "^2.0.0", @@ -2137,7 +2196,7 @@ "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } @@ -2145,7 +2204,7 @@ "conventional-commits-filter": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/conventional-commits-filter/-/conventional-commits-filter-2.0.6.tgz", - "integrity": "sha1-CTXhJAxcp2mDKa/+4bakbTMyTEw=", + "integrity": "sha512-4g+sw8+KA50/Qwzfr0hL5k5NWxqtrOVw4DDk3/h6L85a9Gz0/Eqp3oP+CWCNfesBvZZZEFHF7OTEbRe+yYSyKw==", "dev": true, "requires": { "lodash.ismatch": "^4.4.0", @@ -2155,7 +2214,7 @@ "conventional-commits-parser": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/conventional-commits-parser/-/conventional-commits-parser-3.1.0.tgz", - "integrity": "sha1-EBQGc9Xn71VyYzeRRWxdA7aei+Q=", + "integrity": "sha512-RSo5S0WIwXZiRxUGTPuYFbqvrR4vpJ1BDdTlthFgvHt5kEdnd1+pdvwWphWn57/oIl4V72NMmOocFqqJ8mFFhA==", "dev": true, "requires": { "JSONStream": "^1.0.4", @@ -2170,7 +2229,7 @@ "conventional-recommended-bump": { "version": "6.0.9", "resolved": "https://registry.npmjs.org/conventional-recommended-bump/-/conventional-recommended-bump-6.0.9.tgz", - "integrity": "sha1-Se509S+6/MY+ieIpfQICef6jGPA=", + "integrity": "sha512-DpRmW1k8CpRrcsXHOPGgHgOd4BMGiq2gtXAveGM8B9pSd9b4r4WKnqp1Fd0vkDtk8l973mIk8KKKUYnKRr9SFw==", "dev": true, "requires": { "concat-stream": "^2.0.0", @@ -2186,18 +2245,10 @@ "convert-source-map": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.7.0.tgz", - "integrity": "sha1-F6LLiC1/d9NJBYXizmxSRCSjpEI=", + "integrity": "sha512-4FJkXzKXEDB1snCFZlLP4gpC3JILicCpGbzG9f9G7tGqGCzETQ2hWPrcinA9oU4wtf2biUaEH5065UnMeR33oA==", "dev": true, "requires": { "safe-buffer": "~5.1.1" - }, - "dependencies": { - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0=", - "dev": true - } } }, "cookie": { @@ -2209,7 +2260,7 @@ "core-js-compat": { "version": "3.6.5", "resolved": "https://registry.npmjs.org/core-js-compat/-/core-js-compat-3.6.5.tgz", - "integrity": "sha1-KlHZpOJd/W5pAlGqgfmePAVIHxw=", + "integrity": "sha512-7ItTKOhOZbznhXAQ2g/slGg1PJV5zDO/WdkTwi7UEOJmkvsE32PWvx6mKtDjiMpjnR2CNf6BAD6sSxIlv7ptng==", "dev": true, "requires": { "browserslist": "^4.8.5", @@ -2219,7 +2270,7 @@ "semver": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/semver/-/semver-7.0.0.tgz", - "integrity": "sha1-XzyjV2HkfgWyBsba/yz4FPAxa44=", + "integrity": "sha512-+GB6zVA9LWh6zovYQLALHwv5rb2PHGlJi3lfiqIHxR0uuwCgefcOJc59v9fv1w8GbStwxuuqqAjI9NMAOOgq1A==", "dev": true } } @@ -2233,7 +2284,7 @@ "cross-spawn": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha1-9zqFudXUHQRVUcF34ogtSshXKKY=", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", "dev": true, "requires": { "path-key": "^3.1.0", @@ -2268,25 +2319,25 @@ "date-format": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/date-format/-/date-format-3.0.0.tgz", - "integrity": "sha1-64eANlx9KxURB4+0keZHl4DzrZU=", + "integrity": "sha512-eyTcpKOcamdhWJXj56DpQMo1ylSQpcGtGKXcU0Tb97+K56/CF5amAqqqNj0+KvA0iw2ynxtHWFsPDSClCxe48w==", "dev": true }, "dateformat": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/dateformat/-/dateformat-3.0.3.tgz", - "integrity": "sha1-puN0maTZqc+F71hyBE1ikByYia4=", + "integrity": "sha512-jyCETtSl3VMZMWeRo7iY1FL19ges1t55hMo5yaam4Jrsm5EPL89UQkoQRyiI+Yf4k8r2ZpdngkV8hr1lIdjb3Q==", "dev": true }, "debounce": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/debounce/-/debounce-1.2.0.tgz", - "integrity": "sha1-RKVAq8DqmUMBjcDqqVzOh/Zc0TE=", + "integrity": "sha512-mYtLl1xfZLi1m4RtQYlZgJUNQjl4ZxVnHzIR8nLLgi4q1YT8o/WM+MK/f8yfcc9s5Ir5zRaPZyZU6xs1Syoocg==", "dev": true }, "debug": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", - "integrity": "sha1-O3ImAlUQnGtYnO4FDx1RYTlmR5E=", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { "ms": "^2.1.1" @@ -2319,7 +2370,7 @@ "deep-eql": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-3.0.1.tgz", - "integrity": "sha1-38lARACtHI/gI+faHfHBR8S0RN8=", + "integrity": "sha512-+QeIQyN5ZuO+3Uk5DYh6/1eKO0m0YmJFGNmFHGACpf1ClL1nmlV/p4gNgbl2pJGxgXb4faqo6UE+M5ACEMyVcw==", "dev": true, "requires": { "type-detect": "^4.0.0" @@ -2334,13 +2385,13 @@ "deepmerge": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/deepmerge/-/deepmerge-4.2.2.tgz", - "integrity": "sha1-RNLqNnm49NT/ujPwPYZfwee/SVU=", + "integrity": "sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg==", "dev": true }, "default-require-extensions": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-3.0.0.tgz", - "integrity": "sha1-4D+TqsmytkQ/xS5eSjezrZrY35Y=", + "integrity": "sha512-ek6DpXq/SCpvjhpFsLFRVtIxJCRw6fUR42lYMVZuUMK7n8eMz4Uh5clckdBjEpLhn/gEBZo7hDJnJcwdKLKQjg==", "dev": true, "requires": { "strip-bom": "^4.0.0" @@ -2349,7 +2400,7 @@ "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", - "integrity": "sha1-z4jabL7ib+bbcJT2HYcMvYTO6fE=", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "dev": true, "requires": { "object-keys": "^1.0.12" @@ -2364,13 +2415,13 @@ "detect-indent": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/detect-indent/-/detect-indent-6.0.0.tgz", - "integrity": "sha1-Cr0PVJ9p/GZZolT+lnhhhrb1KP0=", + "integrity": "sha512-oSyFlqaTHCItVRGK5RmrmjB+CmaMOW7IaNA/kdxqhoa6d17j/5ce9O9eWXmV/KEdRwqpQA+Vqe8a8Bsybu4YnA==", "dev": true }, "detect-newline": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/detect-newline/-/detect-newline-3.1.0.tgz", - "integrity": "sha1-V29d/GOuGhkv8ZLYrTr2MImRtlE=", + "integrity": "sha512-TLz+x/vEXm/Y7P7wn1EJFNLxYpUD4TgMosxY6fAVJUnJMbupHBOncxyWUG9OpTaH9EBD7uFI5LfEgmMOc54DsA==", "dev": true }, "di": { @@ -2380,15 +2431,15 @@ "dev": true }, "diff": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", - "integrity": "sha1-YPOuy4nV+uUgwRqhnvwruYKq3n0=", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", + "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", "dev": true }, "doctrine": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", - "integrity": "sha1-rd6+rXKmV023g2OdyHoSF3OXOWE=", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "requires": { "esutils": "^2.0.2" @@ -2407,9 +2458,9 @@ } }, "dot-prop": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.2.0.tgz", - "integrity": "sha1-w07MKVVtxF8fTCJpe29JBODMT8s=", + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz", + "integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==", "dev": true, "requires": { "is-obj": "^2.0.0" @@ -2418,7 +2469,7 @@ "dotgitignore": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/dotgitignore/-/dotgitignore-2.1.0.tgz", - "integrity": "sha1-pLFaTk7zzzg1mKrx36SgS8wIm3s=", + "integrity": "sha512-sCm11ak2oY6DglEPpCB8TixLjWAxd3kJTs6UIcSasNYxXdFPV+YKlye92c8H4kKFqV5qYMIh7d+cYecEg0dIkA==", "dev": true, "requires": { "find-up": "^3.0.0", @@ -2428,7 +2479,7 @@ "find-up": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", - "integrity": "sha1-SRafHXmTQwZG2mHsxa41XCHJe3M=", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", "dev": true, "requires": { "locate-path": "^3.0.0" @@ -2437,7 +2488,7 @@ "locate-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", - "integrity": "sha1-2+w7OrdZdYBxtY/ln8QYca8hQA4=", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", "dev": true, "requires": { "p-locate": "^3.0.0", @@ -2447,7 +2498,7 @@ "p-locate": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", - "integrity": "sha1-Mi1poFwCZLJZl9n0DNiokasAZKQ=", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", "dev": true, "requires": { "p-limit": "^2.0.0" @@ -2468,15 +2519,15 @@ "dev": true }, "electron-to-chromium": { - "version": "1.3.549", - "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.549.tgz", - "integrity": "sha1-v1AMjrdacoaoleNPQaoUQ4SsYTs=", + "version": "1.3.564", + "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.3.564.tgz", + "integrity": "sha512-fNaYN3EtKQWLQsrKXui8mzcryJXuA0LbCLoizeX6oayG2emBaS5MauKjCPAvc29NEY4FpLHIUWiP+Y0Bfrs5dg==", "dev": true }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", - "integrity": "sha1-kzoEBShgyF6DwSJHnEdIqOTHIVY=", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, "encodeurl": { @@ -2488,7 +2539,7 @@ "engine.io": { "version": "3.4.2", "resolved": "https://registry.npmjs.org/engine.io/-/engine.io-3.4.2.tgz", - "integrity": "sha1-j8hO4AOI4+IoZF4KfT367tW9Eiw=", + "integrity": "sha512-b4Q85dFkGw+TqgytGPrGgACRUhsdKc9S9ErRAXpPGy/CXKs4tYoHDkvIRdsseAF7NjfVwjRFIn6KTnbw7LwJZg==", "dev": true, "requires": { "accepts": "~1.3.4", @@ -2502,7 +2553,7 @@ "engine.io-client": { "version": "3.4.3", "resolved": "https://registry.npmjs.org/engine.io-client/-/engine.io-client-3.4.3.tgz", - "integrity": "sha1-GS0JhlQD4wl+NXXr/rOGHE0Bpmw=", + "integrity": "sha512-0NGY+9hioejTEJCaSJZfWZLk4FPI9dN+1H1C4+wj2iuFba47UgZbJzfWs4aNFajnX/qAaYKbe2lLTfEEWzCmcw==", "dev": true, "requires": { "component-emitter": "~1.3.0", @@ -2521,13 +2572,13 @@ "component-emitter": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", - "integrity": "sha1-FuQHD7qK4ptnnyIVhT7hgasuq8A=", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", "dev": true }, "ws": { "version": "6.1.4", "resolved": "https://registry.npmjs.org/ws/-/ws-6.1.4.tgz", - "integrity": "sha1-W1yIAK+rkl6UzLKdFTyNAsF3bvk=", + "integrity": "sha512-eqZfL+NE/YQc1/ZynhojeV8q+H050oR8AZ2uIev7RU10svA9ZnJUddHcOUZTJLinZ9yEfdA2kSATS2qZK5fhJA==", "dev": true, "requires": { "async-limiter": "~1.0.0" @@ -2538,7 +2589,7 @@ "engine.io-parser": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/engine.io-parser/-/engine.io-parser-2.2.0.tgz", - "integrity": "sha1-MSxIlPV9UqArQgho2ntcHISvgO0=", + "integrity": "sha512-6I3qD9iUxotsC5HEMuuGsKA0cXerGz+4uGcXQEkfBidgKf0amsjrrtwcbwK/nzpZBxclXlV7gGl9dgWvu4LF6w==", "dev": true, "requires": { "after": "0.8.2", @@ -2551,7 +2602,7 @@ "enquirer": { "version": "2.3.6", "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", - "integrity": "sha1-Kn/l3WNKHkElqXXsmU/1RW3Dc00=", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", "dev": true, "requires": { "ansi-colors": "^4.1.1" @@ -2566,7 +2617,7 @@ "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", - "integrity": "sha1-tKxAZIEH/c3PriQvQovqihTU8b8=", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { "is-arrayish": "^0.2.1" @@ -2575,13 +2626,13 @@ "es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", - "integrity": "sha1-njr0B0Wd7tR+mpH5uIWoTrBcVh0=", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", "dev": true }, "escalade": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.0.2.tgz", - "integrity": "sha1-algNcO24eIDyK0yR0NVgeN9pYsQ=", + "integrity": "sha512-gPYAU37hYCUhW5euPeR+Y74F7BL+IBsV93j5cvGriSaD1aG6MGsqsV1yamRdrWrb2j3aiZvb0X+UBOWpx3JWtQ==", "dev": true }, "escape-html": { @@ -2597,12 +2648,13 @@ "dev": true }, "eslint": { - "version": "7.7.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.7.0.tgz", - "integrity": "sha1-GL66UUEZJ8S2TaCozq3v5AMNYHM=", + "version": "7.8.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-7.8.1.tgz", + "integrity": "sha512-/2rX2pfhyUG0y+A123d0ccXtMm7DV7sH1m3lk9nk2DZ2LReq39FXHueR9xZwshE5MdfSf0xunSaMWRqyIA6M1w==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", + "@eslint/eslintrc": "^0.1.3", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -2612,7 +2664,7 @@ "eslint-scope": "^5.1.0", "eslint-utils": "^2.1.0", "eslint-visitor-keys": "^1.3.0", - "espree": "^7.2.0", + "espree": "^7.3.0", "esquery": "^1.2.0", "esutils": "^2.0.2", "file-entry-cache": "^5.0.1", @@ -2643,7 +2695,7 @@ "ansi-styles": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", "dev": true, "requires": { "@types/color-name": "^1.1.1", @@ -2653,7 +2705,7 @@ "chalk": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", - "integrity": "sha1-ThSHCmGNni7dl92DRf2dncMVZGo=", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", "dev": true, "requires": { "ansi-styles": "^4.1.0", @@ -2663,7 +2715,7 @@ "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { "color-name": "~1.1.4" @@ -2672,13 +2724,13 @@ "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "globals": { "version": "12.4.0", "resolved": "https://registry.npmjs.org/globals/-/globals-12.4.0.tgz", - "integrity": "sha1-oYgTV2pBsAokqX5/gVkYwuGZJfg=", + "integrity": "sha512-BWICuzzDvDoH54NHKCseDanAhE3CeDorgDL5MT6LMXXj2WCnd9UC2szdk4AWLfjdgNBCXLUanXYcpBBKOSWGwg==", "dev": true, "requires": { "type-fest": "^0.8.1" @@ -2687,19 +2739,19 @@ "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "semver": { "version": "7.3.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha1-YElisFK4HtB4aq6EOJ/7pw/9OTg=", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true }, "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { "has-flag": "^4.0.0" @@ -2710,7 +2762,7 @@ "eslint-config-prettier": { "version": "6.11.0", "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-6.11.0.tgz", - "integrity": "sha1-9tIjjBKQ0ByFmotcH301KgsNqLE=", + "integrity": "sha512-oB8cpLWSAjOVFEJhhyMZh6NOEOtBVziaqdDQ86+qhDHFbZXoRTM7pNSvFRfW/W/L/LrQ38C99J5CGuRBBzBsdA==", "dev": true, "requires": { "get-stdin": "^6.0.0" @@ -2719,16 +2771,34 @@ "eslint-plugin-prettier": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-3.1.4.tgz", - "integrity": "sha1-Foq0MVTi6lfbmSos0JfIKBcfdcI=", + "integrity": "sha512-jZDa8z76klRqo+TdGDTFJSavwbnWK2ZpqGKNZ+VvweMW516pDUMmQ2koXvxEE4JhzNvTv+radye/bWGBmA6jmg==", "dev": true, "requires": { "prettier-linter-helpers": "^1.0.0" } }, + "eslint-plugin-tsdoc": { + "version": "0.2.7", + "resolved": "https://registry.npmjs.org/eslint-plugin-tsdoc/-/eslint-plugin-tsdoc-0.2.7.tgz", + "integrity": "sha512-GAbNpwNfwnolagP6mCQT8wY4usifnAE/iuCz15L3BcEca0xAidctU61h7w40mOuNiSp78DYPUl5gwN89nJ8+8Q==", + "dev": true, + "requires": { + "@microsoft/tsdoc": "0.12.21", + "@microsoft/tsdoc-config": "0.13.6" + }, + "dependencies": { + "@microsoft/tsdoc": { + "version": "0.12.21", + "resolved": "https://registry.npmjs.org/@microsoft/tsdoc/-/tsdoc-0.12.21.tgz", + "integrity": "sha512-j+9OJ0A0buZZaUn6NxeHUVpoa05tY2PgVs7kXJhJQiKRB0G1zQqbJxer3T7jWtzpqQWP89OBDluyIeyTsMk8Sg==", + "dev": true + } + } + }, "eslint-scope": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-5.1.0.tgz", - "integrity": "sha1-0Plx3+WcaeDK2mhLI9Sdv4JgDOU=", + "integrity": "sha512-iiGRvtxWqgtx5m8EyQUJihBloE4EnYeGE/bz1wSPwJE6tZuJUtHlhqDM4Xj2ukE8Dyy1+HCZ4hE0fzIVMzb58w==", "dev": true, "requires": { "esrecurse": "^4.1.0", @@ -2738,7 +2808,7 @@ "eslint-utils": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-2.1.0.tgz", - "integrity": "sha1-0t5eA0JOcH3BDHQGjd7a5wh0Gyc=", + "integrity": "sha512-w94dQYoauyvlDc43XnGB8lU3Zt713vNChgt4EWwhXAP2XkBvndfxF0AgIqKOOasjPIPzj9JqgwkwbCYD0/V3Zg==", "dev": true, "requires": { "eslint-visitor-keys": "^1.1.0" @@ -2747,13 +2817,13 @@ "eslint-visitor-keys": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.3.0.tgz", - "integrity": "sha1-MOvR73wv3/AcOk8VEESvJfqwUj4=", + "integrity": "sha512-6J72N8UNa462wa/KFODt/PJ3IU60SDpC3QXC1Hjc1BXXpfL2C9R5+AU7jhe0F6GREqVMh4Juu+NY7xn+6dipUQ==", "dev": true }, "espree": { "version": "7.3.0", "resolved": "https://registry.npmjs.org/espree/-/espree-7.3.0.tgz", - "integrity": "sha1-3DBDfPZ5R89XYSHr14DxXurHI0g=", + "integrity": "sha512-dksIWsvKCixn1yrEXO8UosNSxaDoSYpq9reEjZSbHLpT5hpaCAKTLBwq0RHtLrIr+c0ByiYzWT8KTMRzoRCNlw==", "dev": true, "requires": { "acorn": "^7.4.0", @@ -2764,13 +2834,13 @@ "esprima": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", - "integrity": "sha1-E7BM2z5sXRnfkatph6hpVhmwqnE=", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", "dev": true }, "esquery": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.3.1.tgz", - "integrity": "sha1-t4tYKKqOIU4p+3TE1bdS4cAz2lc=", + "integrity": "sha512-olpvt9QG0vniUBZspVRN6lwB7hOZoTRtT+jzR+tS4ffYx2mzbw+z0XCOk44aaLYKApNX5nMm+E+P6o25ip/DHQ==", "dev": true, "requires": { "estraverse": "^5.1.0" @@ -2779,66 +2849,74 @@ "estraverse": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", - "integrity": "sha1-MH30JUfmzHMk088DwVXVzbjFOIA=", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", "dev": true } } }, "esrecurse": { - "version": "4.2.1", - "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", - "integrity": "sha1-AHo7n9vCs7uH5IeeoZyS/b05Qs8=", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.3.0.tgz", + "integrity": "sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag==", "dev": true, "requires": { - "estraverse": "^4.1.0" + "estraverse": "^5.2.0" + }, + "dependencies": { + "estraverse": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.2.0.tgz", + "integrity": "sha512-BxbNGGNm0RyRYvUdHpIwv9IWzeM9XClbOxwoATuFdOE7ZE6wHL+HQ5T8hoPM+zHvmKzzsEqhgy0GrQ5X13afiQ==", + "dev": true + } } }, "estraverse": { "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", - "integrity": "sha1-OYrT88WiSUi+dyXoPRGn3ijNvR0=", + "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", "dev": true }, "estree-walker": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-1.0.1.tgz", - "integrity": "sha1-MbxdYSyWtwQQa0d+bdXYqhOMtwA=", + "integrity": "sha512-1fMXF3YP4pZZVozF8j/ZLfvnR8NSIljt56UhbZ5PeeDmmGHpgpdwQt7ITlGvYaQukCvuBRMLEiKiYC+oeIg4cg==", "dev": true }, "esutils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", - "integrity": "sha1-dNLrTeC42hKTcRkQ1Qd1ubcQ72Q=", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, "eventemitter3": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.6.tgz", - "integrity": "sha1-Elj2+lG0kIqtws1iT81uZPmfSdY=", + "version": "4.0.7", + "resolved": "https://registry.npmjs.org/eventemitter3/-/eventemitter3-4.0.7.tgz", + "integrity": "sha512-8guHBZCwKnFhYdHr2ysuRWErTwhoN2X8XELRlrRwpmfeY2jjuUN4taQMsULKUVo1K4DvZl+0pgfyoysHxvmvEw==", "dev": true }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", - "integrity": "sha1-+LETa0Bx+9jrFAr/hYsQGewpFfo=", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", - "integrity": "sha1-On1WtVnWy8PrUSMlJE5hmmXGxSU=", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", "dev": true }, "fast-diff": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", - "integrity": "sha1-c+4RmC2Gyq95WYKNUZz+kn+sXwM=", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", "dev": true }, "fast-json-stable-stringify": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", - "integrity": "sha1-h0v2nG9ATCtdmcSBNBOZ/VWJJjM=", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", "dev": true }, "fast-levenshtein": { @@ -2850,7 +2928,7 @@ "figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", - "integrity": "sha1-YlwYvSk8YE3EqN2y/r8MiDQXRq8=", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", "dev": true, "requires": { "escape-string-regexp": "^1.0.5" @@ -2859,7 +2937,7 @@ "file-entry-cache": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", - "integrity": "sha1-yg9u+m3T1WEzP7FFFQZcL6/fQ5w=", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", "dev": true, "requires": { "flat-cache": "^2.0.1" @@ -2868,7 +2946,7 @@ "fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", - "integrity": "sha1-GRmmp8df44ssfHflGYU12prN2kA=", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", "dev": true, "requires": { "to-regex-range": "^5.0.1" @@ -2877,7 +2955,7 @@ "finalhandler": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.1.2.tgz", - "integrity": "sha1-t+fQAP/RGTjQ/bBTUG9uur6fWH0=", + "integrity": "sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA==", "dev": true, "requires": { "debug": "2.6.9", @@ -2892,7 +2970,7 @@ "debug": { "version": "2.6.9", "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha1-XRKFFd8TT/Mn6QpMk/Tgd6U2NB8=", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", "dev": true, "requires": { "ms": "2.0.0" @@ -2909,7 +2987,7 @@ "find-cache-dir": { "version": "3.3.1", "resolved": "https://registry.npmjs.org/find-cache-dir/-/find-cache-dir-3.3.1.tgz", - "integrity": "sha1-ibM/rUpGcNqpT4Vff74x1thP6IA=", + "integrity": "sha512-t2GDMt3oGC/v+BMwzmllWDuJF/xcDtE5j/fCGbqDD7OLuJkj0cfh1YSA5VKPvwMeLFLNDBkwOKZ2X85jGLVftQ==", "dev": true, "requires": { "commondir": "^1.0.1", @@ -2920,7 +2998,7 @@ "find-up": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", - "integrity": "sha1-l6/n1s3AvFkoWEt8jXsW6KmqXRk=", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", "dev": true, "requires": { "locate-path": "^5.0.0", @@ -2930,7 +3008,7 @@ "flat-cache": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", - "integrity": "sha1-XSltbwS9pEpGMKMBQTvbwuwIXsA=", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", "dev": true, "requires": { "flatted": "^2.0.0", @@ -2941,7 +3019,7 @@ "rimraf": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", - "integrity": "sha1-stEE/g2Psnz54KHNqCYt04M8bKs=", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "requires": { "glob": "^7.1.3" @@ -2952,19 +3030,19 @@ "flatted": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.2.tgz", - "integrity": "sha1-RXWyHivO50NKqb5mL0t7X5wrUTg=", + "integrity": "sha512-r5wGx7YeOwNWNlCA0wQ86zKyDLMQr+/RB8xy74M4hTphfmjlijTSSXGuH8rnvKZnfT9i+75zmd8jcKdMR4O6jA==", "dev": true }, "follow-redirects": { "version": "1.13.0", "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.13.0.tgz", - "integrity": "sha1-tC6Nk6Kn7qXtiGM2dtZZe8jjhNs=", + "integrity": "sha512-aq6gF1BEKje4a9i9+5jimNFIpq4Q1WiwBToeRK5NvZBd/TRsmW8BsJfOEGkr76TbOyPVD3OVDN910EcUNtRYEA==", "dev": true }, "foreground-child": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-2.0.0.tgz", - "integrity": "sha1-cbMoAMnxWqjy+D9Ka9m/812GGlM=", + "integrity": "sha512-dCIq9FpEcyQyXKCkyzmlPTFNgrCzPudOe+mhvJU5zAtlBnGVy2yKxtfsxK2tQBThwq225jcvBjpw1Gr40uzZCA==", "dev": true, "requires": { "cross-spawn": "^7.0.0", @@ -2974,7 +3052,7 @@ "fromentries": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/fromentries/-/fromentries-1.2.1.tgz", - "integrity": "sha1-ZMMWZWMEebyZPNgA1TOHkg3GG00=", + "integrity": "sha512-Xu2Qh8yqYuDhQGOhD5iJGninErSfI9A3FrriD3tjUgV5VbJFeH8vfgZ9HnC6jWN80QDVNQK5vmxRAmEAp7Mevw==", "dev": true }, "fs-access": { @@ -2989,7 +3067,7 @@ "fs-extra": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha1-TxicRKoSO4lfcigE9V6iPq3DSOk=", + "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -3013,7 +3091,7 @@ "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", - "integrity": "sha1-pWiZ0+o8m6uHS7l3O3xe3pL0iV0=", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", "dev": true }, "functional-red-black-tree": { @@ -3025,13 +3103,13 @@ "gensync": { "version": "1.0.0-beta.1", "resolved": "https://registry.npmjs.org/gensync/-/gensync-1.0.0-beta.1.tgz", - "integrity": "sha1-WPQ2H/mH5f9uHnohCCeqNx6qwmk=", + "integrity": "sha512-r8EC6NO1sngH/zdD9fiRDLdcgnbayXah+mLgManTaIZJqEC1MZstmnox8KpnI2/fxQwrp5OpCOYWLp4rBl4Jcg==", "dev": true }, "get-caller-file": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha1-T5RBKoLbMvNuOwuXQfipf+sDH34=", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", "dev": true }, "get-func-name": { @@ -3043,7 +3121,7 @@ "get-package-type": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/get-package-type/-/get-package-type-0.1.0.tgz", - "integrity": "sha1-jeLYA8/0TfO8bEVuZmizbDkm4Ro=", + "integrity": "sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q==", "dev": true }, "get-pkg-repo": { @@ -3163,7 +3241,7 @@ "readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha1-Hsoc9xGu+BTAT2IlKjamL2yyO1c=", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -3185,16 +3263,10 @@ "strip-indent": "^1.0.1" } }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0=", - "dev": true - }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha1-nPFhG6YmhdcDCunkujQUnDrwP8g=", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" @@ -3212,7 +3284,7 @@ "through2": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha1-AcHjnrMdB8t9A6lqcIIyYLIxMs0=", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "requires": { "readable-stream": "~2.3.6", @@ -3230,13 +3302,13 @@ "get-stdin": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-6.0.0.tgz", - "integrity": "sha1-ngm/cSs2CrkiXoEgSPcf3pyJZXs=", + "integrity": "sha512-jp4tHawyV7+fkkSKyvjuLZswblUtz+SQKzSWnBbii16BuZksJlU1wuBYXY75r+duh/llF1ur6oNwi+2ZzjKZ7g==", "dev": true }, "git-raw-commits": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/git-raw-commits/-/git-raw-commits-2.0.0.tgz", - "integrity": "sha1-2Srd90RAwUvMXIPszj+3+KeRGLU=", + "integrity": "sha512-w4jFEJFgKXMQJ0H0ikBk2S+4KP2VEjhCvLCNqbNRQC8BgGWgLKNCO7a9K9LI+TVT7Gfoloje502sEnctibffgg==", "dev": true, "requires": { "dargs": "^4.0.1", @@ -3284,7 +3356,7 @@ "meow": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/meow/-/meow-4.0.1.tgz", - "integrity": "sha1-1IWY9vSxRy81v2MXqVlFrONH+XU=", + "integrity": "sha512-xcSBHD5Z86zaOc+781KrupuHAzeGXSLtiAOmBsiLDiPSaYSB6hdew2ng9EBAnZ62jagG9MHAOdxpDi/lWBFJ/A==", "dev": true, "requires": { "camelcase-keys": "^4.0.0", @@ -3301,7 +3373,7 @@ "minimist-options": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", - "integrity": "sha1-+6TIGRM54T7PTWG+sD8HAQPz2VQ=", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", "dev": true, "requires": { "arrify": "^1.0.1", @@ -3317,7 +3389,7 @@ "readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha1-Hsoc9xGu+BTAT2IlKjamL2yyO1c=", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -3339,16 +3411,10 @@ "strip-indent": "^2.0.0" } }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0=", - "dev": true - }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha1-nPFhG6YmhdcDCunkujQUnDrwP8g=", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" @@ -3363,7 +3429,7 @@ "through2": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha1-AcHjnrMdB8t9A6lqcIIyYLIxMs0=", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "requires": { "readable-stream": "~2.3.6", @@ -3391,7 +3457,7 @@ "git-semver-tags": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/git-semver-tags/-/git-semver-tags-4.1.0.tgz", - "integrity": "sha1-AUbJvCTulhBMmfRDBxyMLX3ISOM=", + "integrity": "sha512-TcxAGeo03HdErzKzi4fDD+xEL7gi8r2Y5YSxH6N2XYdVSV5UkBwfrt7Gqo1b+uSHCjy/sa9Y6BBBxxFLxfbhTg==", "dev": true, "requires": { "meow": "^7.0.0", @@ -3401,7 +3467,7 @@ "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } @@ -3418,7 +3484,7 @@ "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", - "integrity": "sha1-FB8zuBp8JJLhJVlDB0gMRmeSeKY=", + "integrity": "sha512-LwaxwyZ72Lk7vZINtNNrywX0ZuLyStrdDtabefZKAY5ZGJhVtgdznluResxNmPitE0SAO+O26sWTHeKSI2wMBA==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -3432,7 +3498,7 @@ "glob-parent": { "version": "5.1.1", "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha1-tsHvQXxOVmPqSY8cRa+saRa7wik=", + "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", "dev": true, "requires": { "is-glob": "^4.0.1" @@ -3441,25 +3507,25 @@ "globals": { "version": "11.12.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", - "integrity": "sha1-q4eVM4hooLq9hSV1gBjCp+uVxC4=", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", "dev": true }, "graceful-fs": { "version": "4.2.4", "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", - "integrity": "sha1-Ila94U02MpWMRl68ltxGfKB6Kfs=", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==", "dev": true }, "growl": { "version": "1.10.5", "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha1-8nNdwig2dPpnR4sQGBBZNVw2nl4=", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", "dev": true }, "handlebars": { "version": "4.7.6", "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.7.6.tgz", - "integrity": "sha1-1MBcG6+Q6ZRfd6pop6IZqkp9904=", + "integrity": "sha512-1f2BACcBfiwAfStCKZNrUCgqNZkGsAT7UM3kkYtXuLo0KnaVfjKOyf7PRzB6++aK9STyT1Pd2ZCPe3EGOXleXA==", "dev": true, "requires": { "minimist": "^1.2.5", @@ -3472,7 +3538,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } @@ -3480,13 +3546,13 @@ "hard-rejection": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/hard-rejection/-/hard-rejection-2.1.0.tgz", - "integrity": "sha1-HG7aXBaFxjlCdm15u0Cudzzs2IM=", + "integrity": "sha512-VIZB+ibDhx7ObhAe7OVtoEbuP4h/MuOTHJ+J8h/eBXotJYl0fBgR72xDFCKgIh22OJZIOVNxBMWuhAr10r8HdA==", "dev": true }, "has-binary2": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has-binary2/-/has-binary2-1.0.3.tgz", - "integrity": "sha1-d3asYn8+p3JQz8My2rfd9eT10R0=", + "integrity": "sha512-G1LWKhDSvhGeAQ8mPVQlqNcOB2sJdwATtZKl2pDKKHfpf/rYj24lkinxf69blJbnsvtqqNU+L3SL50vzZhXOnw==", "dev": true, "requires": { "isarray": "2.0.1" @@ -3507,13 +3573,13 @@ "has-symbols": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.1.tgz", - "integrity": "sha1-n1IUdYpEGWxAbZvXbOv4HsLdMeg=", + "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "dev": true }, "hasha": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.2.0.tgz", - "integrity": "sha1-MwlNH2nECkpqx75T1f4/+Vomngw=", + "integrity": "sha512-2W+jKdQbAdSIrggA8Q35Br8qKadTrqCTC8+XZvBWepKDK6m9XkX6Iz1a2yh2KP01kzAR/dpuMeUnocoLYDcskw==", "dev": true, "requires": { "is-stream": "^2.0.0", @@ -3527,27 +3593,27 @@ "dev": true }, "highlight.js": { - "version": "10.1.2", - "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.1.2.tgz", - "integrity": "sha512-Q39v/Mn5mfBlMff9r+zzA+gWxRsCRKwEMvYTiisLr/XUiFI/4puWt0Ojdko3R3JCNWGdOWaA5g/Yxqa23kC5AA==", + "version": "10.2.0", + "resolved": "https://registry.npmjs.org/highlight.js/-/highlight.js-10.2.0.tgz", + "integrity": "sha512-OryzPiqqNCfO/wtFo619W+nPYALM6u7iCQkum4bqRmmlcTikOkmlL06i009QelynBPAlNByTQU6cBB2cOBQtCw==", "dev": true }, "hosted-git-info": { "version": "2.8.8", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.8.8.tgz", - "integrity": "sha1-dTm9S8Hg4KiVgVouAmJCCxKFhIg=", + "integrity": "sha512-f/wzC2QaWBs7t9IYqB4T3sR1xviIViXJRJTWBlx2Gf3g0Xi5vI7Yy4koXQ1c9OYDGHN9sBy1DQ2AB8fqZBWhUg==", "dev": true }, "html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", - "integrity": "sha1-39YAJ9o2o238viNiYsAKWCJoFFM=", + "integrity": "sha512-H2iMtd0I4Mt5eYiapRdIDjp+XzelXQ0tFE4JS7YFwFevXXMmOp9myNrUvCg0D6ws8iqkRPBfKHgbwig1SmlLfg==", "dev": true }, "http-errors": { "version": "1.7.2", "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-1.7.2.tgz", - "integrity": "sha1-T1ApzxMjnzEDblsuVSkrz7zIXI8=", + "integrity": "sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg==", "dev": true, "requires": { "depd": "~1.1.2", @@ -3568,7 +3634,7 @@ "http-proxy": { "version": "1.18.1", "resolved": "https://registry.npmjs.org/http-proxy/-/http-proxy-1.18.1.tgz", - "integrity": "sha1-QBVB8FNIhLv5UmAzTnL4juOXZUk=", + "integrity": "sha512-7mz/721AbnJwIVbnaSv1Cz3Am0ZLT/UBwkC92VlxhXv/k/BBQfM2fXElQNC27BVGr0uwUpplYPQM9LnaBMR5NQ==", "dev": true, "requires": { "eventemitter3": "^4.0.0", @@ -3579,7 +3645,7 @@ "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", - "integrity": "sha1-ICK0sl+93CHS9SSXSkdKr+czkIs=", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "requires": { "safer-buffer": ">= 2.1.2 < 3" @@ -3588,18 +3654,18 @@ "ieee754": { "version": "1.1.13", "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.1.13.tgz", - "integrity": "sha1-7BaFWOlaoYH9h9N/VcMrvLZwi4Q=" + "integrity": "sha512-4vf7I2LYV/HaWerSo3XmlMkp5eZ83i+/CDluXi/IGTs/O1sejBNhTtnxzmRZfvOUqj7lZjqHkeTvpgSFDlWZTg==" }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", - "integrity": "sha1-dQ49tYYgh7RzfrrIIH/9HvJ7Jfw=", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, "import-fresh": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", - "integrity": "sha1-Yz/2GFBueTr1rJG/SLcmd+FcvmY=", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", "dev": true, "requires": { "parent-module": "^1.0.0", @@ -3609,7 +3675,7 @@ "import-lazy": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-4.0.0.tgz", - "integrity": "sha1-6OtidIOgpD2jwD8+NVSL5csMwVM=", + "integrity": "sha512-rKtvo6a868b5Hu3heneU+L4yEQ4jYKLtjpnPeUdK7h0yzXGmyBTypknlkCvHFBqfX9YlorEiMM6Dnq/5atfHkw==", "dev": true }, "imurmurhash": { @@ -3621,7 +3687,7 @@ "indent-string": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", - "integrity": "sha1-Yk+PRJfWGbLZdoUx1Y9BIoVNclE=", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", "dev": true }, "indexof": { @@ -3643,25 +3709,25 @@ "inherits": { "version": "2.0.4", "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha1-D6LGT5MpF8NDOg3tVTY6rjdBa3w=", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", "dev": true }, "ini": { "version": "1.3.5", "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha1-7uJfVtscnsYIXgwid4CD9Zar+Sc=", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==", "dev": true }, "interpret": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/interpret/-/interpret-1.4.0.tgz", - "integrity": "sha1-Zlq4vE2iendKQFhOgS4+D6RbGh4=", + "integrity": "sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA==", "dev": true }, "invariant": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", - "integrity": "sha1-YQ88ksk1nOHbYW5TgAjSP/NRWOY=", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", "dev": true, "requires": { "loose-envify": "^1.0.0" @@ -3676,7 +3742,7 @@ "is-binary-path": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha1-6h9/O4DwZCNug0cPhsCcJU+0Wwk=", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", "dev": true, "requires": { "binary-extensions": "^2.0.0" @@ -3691,7 +3757,7 @@ "is-finite": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-finite/-/is-finite-1.1.0.tgz", - "integrity": "sha1-kEE1x3+0LAZB1qobzbxNqo2ggvM=", + "integrity": "sha512-cdyMtqX/BOqqNBBiKlIVkytNHm49MtMlYyn1zxzvJKWmFMlGzm+ry5BBfYyeY9YmNKbRSo/o7OX9w9ale0wg3w==", "dev": true }, "is-fullwidth-code-point": { @@ -3703,7 +3769,7 @@ "is-glob": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", - "integrity": "sha1-dWfb6fL14kZ7x3q4PEopSCQHpdw=", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", "dev": true, "requires": { "is-extglob": "^2.1.1" @@ -3718,13 +3784,13 @@ "is-number": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha1-dTU0W4lnNNX4DE0GxQlVUnoU8Ss=", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", "dev": true }, "is-obj": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", - "integrity": "sha1-Rz+wXZc3BeP9liBUUBjKjiLvSYI=", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", "dev": true }, "is-plain-obj": { @@ -3736,7 +3802,7 @@ "is-reference": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", - "integrity": "sha1-iy2sCzcfS8mU/eq6nrVC0DAC0Lc=", + "integrity": "sha512-U82MsXXiFIrjCK4otLT+o2NA2Cd2g5MLoOVXUZjIOhLurrRxpEXzI8O0KZHr3IjLvlAH1kTPYSuqer5T9ZVBKQ==", "dev": true, "requires": { "@types/estree": "*" @@ -3745,7 +3811,7 @@ "is-stream": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", - "integrity": "sha1-venDJoDW+uBBKdasnZIc54FfeOM=", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", "dev": true }, "is-text-path": { @@ -3772,7 +3838,7 @@ "is-windows": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", - "integrity": "sha1-0YUOuXkezRjmGCzhKjDzlmNLsZ0=", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", "dev": true }, "isarray": { @@ -3784,7 +3850,7 @@ "isbinaryfile": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/isbinaryfile/-/isbinaryfile-4.0.6.tgz", - "integrity": "sha1-7ctisiTitHEIMLZ0mMjk5aTSYQs=", + "integrity": "sha512-ORrEy+SNVqUhrCaal4hA4fBzhggQQ+BaLntyPOdoEiwlKZW9BZiJXjg3RMiruE4tPEI3pyVPpySHQF/dKWperg==", "dev": true }, "isexe": { @@ -3796,13 +3862,13 @@ "istanbul-lib-coverage": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-3.0.0.tgz", - "integrity": "sha1-9ZRKN8cLVQsCp4pcOyBVsoDOyOw=", + "integrity": "sha512-UiUIqxMgRDET6eR+o5HbfRYP1l0hqkWOs7vNxC/mggutCMUIhWMm8gAHb8tHlyfD3/l6rlgNA5cKdDzEAf6hEg==", "dev": true }, "istanbul-lib-hook": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-3.0.0.tgz", - "integrity": "sha1-j4TJQ0iIzGsdCp1wkqdtI56/DMY=", + "integrity": "sha512-Pt/uge1Q9s+5VAZ+pCo16TYMWPBIl+oaNIjgLQxcX0itS6ueeaA+pEfThZpH8WxhFgCiEb8sAJY6MdUKgiIWaQ==", "dev": true, "requires": { "append-transform": "^2.0.0" @@ -3811,7 +3877,7 @@ "istanbul-lib-instrument": { "version": "4.0.3", "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-4.0.3.tgz", - "integrity": "sha1-hzxv/4l0UBGCIndGlqPyiQLXfB0=", + "integrity": "sha512-BXgQl9kf4WTCPCCpmFGoJkz/+uhvm7h7PFKUYxh7qarQd3ER33vHG//qaE8eN25l07YqZPpHXU9I09l/RD5aGQ==", "dev": true, "requires": { "@babel/core": "^7.7.5", @@ -3823,7 +3889,7 @@ "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } @@ -3831,7 +3897,7 @@ "istanbul-lib-processinfo": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/istanbul-lib-processinfo/-/istanbul-lib-processinfo-2.0.2.tgz", - "integrity": "sha1-4UJlFGYiRLLyXfco6P0bo1/lO5w=", + "integrity": "sha512-kOwpa7z9hme+IBPZMzQ5vdQj8srYgAtaRqeI48NGmAQ+/5yKiHLV0QbYqQpxsdEF0+w14SoB8YbnHKcXE2KnYw==", "dev": true, "requires": { "archy": "^1.0.0", @@ -3846,7 +3912,7 @@ "istanbul-lib-report": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz", - "integrity": "sha1-dRj+UupE3jcvRgp2tezan/tz2KY=", + "integrity": "sha512-wcdi+uAKzfiGT2abPpKZ0hSU1rGQjUQnLvtY5MpQ7QCTahD3VODhcu4wcfY1YtkGaDD5yuydOLINXsfbus9ROw==", "dev": true, "requires": { "istanbul-lib-coverage": "^3.0.0", @@ -3857,13 +3923,13 @@ "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha1-lEdx/ZyByBJlxNaUGGDaBrtZR5s=", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", "dev": true }, "supports-color": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", - "integrity": "sha1-aOMlkd9z4lrRxLSRCKLsUHliv9E=", + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", "dev": true, "requires": { "has-flag": "^4.0.0" @@ -3874,7 +3940,7 @@ "istanbul-lib-source-maps": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-4.0.0.tgz", - "integrity": "sha1-dXQ85tlruG3H7kNSz2Nmoj8LGtk=", + "integrity": "sha512-c16LpFRkR8vQXyHZ5nLpY35JZtzj1PQY1iZmesUbf1FZHbIupcWfjgOXBY9YHkLEQ6puz1u4Dgj6qmU/DisrZg==", "dev": true, "requires": { "debug": "^4.1.1", @@ -3885,7 +3951,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } @@ -3893,7 +3959,7 @@ "istanbul-reports": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-3.0.2.tgz", - "integrity": "sha1-1ZMhDlAAaDdQywn8BkTktuJ/1Ts=", + "integrity": "sha512-9tZvz7AiR3PEDNGiV9vIouQ/EAcqMXFmkcA1CDFTwOB98OZVDL0PH9glHotf5Ugp6GCOTypfzGWI/OqjWNCRUw==", "dev": true, "requires": { "html-escaper": "^2.0.0", @@ -3909,13 +3975,13 @@ "js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha1-GSA/tZmR35jjoocFDUZHzerzJJk=", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true }, "js-yaml": { "version": "3.14.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.14.0.tgz", - "integrity": "sha1-p6NBcPJqIbsWJCTYray0ETpp5II=", + "integrity": "sha512-/4IbIeHcD9VMHFqDR/gQ7EdZdLimOvW2DdcxFjdyyZ9NsbS+ccrXqVWDtab/lRl5AlUqmpBx8EhPaWR+OtY17A==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -3925,25 +3991,25 @@ "jsesc": { "version": "2.5.2", "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", - "integrity": "sha1-gFZNLkg9rPbo7yCWUKZ98/DCg6Q=", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true }, "json-parse-better-errors": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", - "integrity": "sha1-u4Z8+zRQ5pEHwTHRxRS6s9yLyqk=", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, "json-parse-even-better-errors": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.0.tgz", - "integrity": "sha1-Nxhzxf+kQwSmuhJBm8+pX0BK4IE=", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", "dev": true }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", - "integrity": "sha1-afaofZUTq4u4/mO9sJecRI5oRmA=", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "json-stable-stringify-without-jsonify": { @@ -3961,7 +4027,7 @@ "json5": { "version": "2.1.3", "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.3.tgz", - "integrity": "sha1-ybD3+pIzv+WAf+ZvzzpWF+1ZfUM=", + "integrity": "sha512-KXPvOm8K9IJKFM0bmdn8QXh7udDh1g/giieX0NLCaMnb4hEiVFqnop2ImTXCc5e0/oHz3LTqmHGtExn5hfMkOA==", "dev": true, "requires": { "minimist": "^1.2.5" @@ -3983,24 +4049,23 @@ "dev": true }, "karma": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/karma/-/karma-5.1.1.tgz", - "integrity": "sha1-TkcsHlNS1z7b0gkHJq/bAdeGnXI=", + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/karma/-/karma-5.2.1.tgz", + "integrity": "sha512-+/AO2fWL7kC3aWTx/lHjtKXfOqh0O+KLtTy4BLQ/b/eciHR4VTHHdPhdrn9sDBQskgDieaBZ+sAKzlldc4GW/Q==", "dev": true, "requires": { "body-parser": "^1.19.0", "braces": "^3.0.2", - "chokidar": "^3.0.0", + "chokidar": "^3.4.2", "colors": "^1.4.0", "connect": "^3.7.0", "di": "^0.0.1", "dom-serialize": "^2.2.1", - "flatted": "^2.0.2", "glob": "^7.1.6", "graceful-fs": "^4.2.4", "http-proxy": "^1.18.1", "isbinaryfile": "^4.0.6", - "lodash": "^4.17.15", + "lodash": "^4.17.19", "log4js": "^6.2.1", "mime": "^2.4.5", "minimatch": "^3.0.4", @@ -4008,7 +4073,7 @@ "range-parser": "^1.2.1", "rimraf": "^3.0.2", "socket.io": "^2.3.0", - "source-map": "^0.6.1", + "source-map": "^0.7.3", "tmp": "0.2.1", "ua-parser-js": "0.7.21", "yargs": "^15.3.1" @@ -4017,13 +4082,13 @@ "colors": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/colors/-/colors-1.4.0.tgz", - "integrity": "sha1-xQSRR51MG9rtLJztMs98fcI2D3g=", + "integrity": "sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA==", "dev": true }, "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "version": "0.7.3", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.3.tgz", + "integrity": "sha512-CkCj6giN3S+n9qrYiBTX5gystlENnRW5jZeNLHpe6aue+SrHcG5VYwujhW9s4dY31mEGsxBDrHR6oI69fTXsaQ==", "dev": true } } @@ -4037,7 +4102,7 @@ "karma-chrome-launcher": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/karma-chrome-launcher/-/karma-chrome-launcher-3.1.0.tgz", - "integrity": "sha1-gFpYZ5mk0F9OVPcqIEl58/MGZzg=", + "integrity": "sha512-3dPs/n7vgz1rxxtynpzZTvb9y/GIaW8xjAwcIGttLbycqoFtI7yo1NGnQi6oFTherRE+GIhCAHZC4vEqWGhNvg==", "dev": true, "requires": { "which": "^1.2.1" @@ -4046,7 +4111,7 @@ "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", - "integrity": "sha1-pFBD1U9YBTFtqNYvn1CRjT2nCwo=", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -4057,7 +4122,7 @@ "karma-mocha": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/karma-mocha/-/karma-mocha-2.0.1.tgz", - "integrity": "sha1-SwJUoY3+5xvb5hiNmmhhv4awzX0=", + "integrity": "sha512-Tzd5HBjm8his2OA4bouAsATYEpZrp9vC7z5E5j4C5Of5Rrs1jY67RAwXNcVmd/Bnk1wgvQRou0zGVLey44G4tQ==", "dev": true, "requires": { "minimist": "^1.2.3" @@ -4094,7 +4159,7 @@ "karma-rollup-preprocessor": { "version": "7.0.5", "resolved": "https://registry.npmjs.org/karma-rollup-preprocessor/-/karma-rollup-preprocessor-7.0.5.tgz", - "integrity": "sha1-0s2cjmVLwUUcMVGLwY5rAiI33v8=", + "integrity": "sha512-VhZI81l8LZBvBrSf4xaojsbur7bcycsSlxXkYaTOjV6DQwx1gtAM0CQVdue7LuIbXB1AohYIg0S5at+dqDtMxQ==", "dev": true, "requires": { "chokidar": "^3.3.1", @@ -4104,19 +4169,19 @@ "kind-of": { "version": "6.0.3", "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", - "integrity": "sha1-B8BQNKbDSfoG4k+jWqdttFgM5N0=", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", "dev": true }, "leven": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/leven/-/leven-3.1.0.tgz", - "integrity": "sha1-d4kd6DQGTMy6gq54QrtrFKE+1/I=", + "integrity": "sha512-qsda+H8jTaUaN/x5vzW2rzc+8Rw4TAQ/4KjB46IwK5VH+IlVeeeje/EoZRpiXvIqjFgK84QffqPztGI3VBLG1A==", "dev": true }, "levenary": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/levenary/-/levenary-1.1.1.tgz", - "integrity": "sha1-hCqe6Y0gdap/ru2+MmeekgX0b3c=", + "integrity": "sha512-mkAdOIt79FD6irqjYSs4rdbnlT5vRonMEvBVPVb3XmevfS8kgRXwfes0dhPdEtzTWD/1eNE/Bm/G1iRt6DcnQQ==", "dev": true, "requires": { "leven": "^3.1.0" @@ -4125,7 +4190,7 @@ "levn": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/levn/-/levn-0.4.1.tgz", - "integrity": "sha1-rkViwAdHO5MqYgDUAyaN0v/8at4=", + "integrity": "sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ==", "dev": true, "requires": { "prelude-ls": "^1.2.1", @@ -4174,7 +4239,7 @@ "locate-path": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", - "integrity": "sha1-Gvujlq/WdqbUJQTQpno6frn2KqA=", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", "dev": true, "requires": { "p-locate": "^4.1.0" @@ -4183,7 +4248,7 @@ "lodash": { "version": "4.17.20", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", - "integrity": "sha1-tEqbYpe8tpjxxRo1RaKzs2jVnFI=", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", "dev": true }, "lodash._reinterpolate": { @@ -4219,7 +4284,7 @@ "lodash.template": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.template/-/lodash.template-4.5.0.tgz", - "integrity": "sha1-+XYZXPPzR9DV9SSDVp/oAxzM6Ks=", + "integrity": "sha512-84vYFxIkmidUiFxidA/KjjH9pAycqW+h980j7Fuz5qxRtO9pgB7MDFTdys1N7A5mcucRiDyEq4fusljItR1T/A==", "dev": true, "requires": { "lodash._reinterpolate": "^3.0.0", @@ -4229,7 +4294,7 @@ "lodash.templatesettings": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/lodash.templatesettings/-/lodash.templatesettings-4.2.0.tgz", - "integrity": "sha1-5IExDwSdPPbUfpEq0JMTsVTw+zM=", + "integrity": "sha512-stgLz+i3Aa9mZgnjr/O+v9ruKZsPsndy7qPZOchbqk2cnTU1ZaldKK+v7m54WoKIyxiuMZTKT2H81F8BeAc3ZQ==", "dev": true, "requires": { "lodash._reinterpolate": "^3.0.0" @@ -4238,7 +4303,7 @@ "log-symbols": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", - "integrity": "sha1-V0Dhxdbw39pK2TI7UzIQfva0xAo=", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", "dev": true, "requires": { "chalk": "^2.0.1" @@ -4247,7 +4312,7 @@ "log4js": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/log4js/-/log4js-6.3.0.tgz", - "integrity": "sha1-EN+vu0NDUaPjAnegC5h5RG9xW8s=", + "integrity": "sha512-Mc8jNuSFImQUIateBFwdOQcmC6Q5maU0VVvdC2R6XMb66/VnT+7WS4D/0EeNMZu1YODmJe5NIn2XftCzEocUgw==", "dev": true, "requires": { "date-format": "^3.0.0", @@ -4260,7 +4325,7 @@ "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", - "integrity": "sha1-ce5R+nvkyuwaY4OffmgtgTLTDK8=", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "dev": true, "requires": { "js-tokens": "^3.0.0 || ^4.0.0" @@ -4285,7 +4350,7 @@ "magic-string": { "version": "0.25.7", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.7.tgz", - "integrity": "sha1-P0l9b9NMZpxnmNy4IfLvMfVEUFE=", + "integrity": "sha512-4CrMT5DOHTDk4HYDlzmwu4FVCcIYI8gauveasrdCu2IKIFOJ3f0v/8MDGJCDL9oD2ppz/Av1b0Nj345H9M+XIA==", "dev": true, "requires": { "sourcemap-codec": "^1.4.4" @@ -4294,7 +4359,7 @@ "make-dir": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.1.0.tgz", - "integrity": "sha1-QV6WcEazp/HRhSd9hKpYIDcmoT8=", + "integrity": "sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw==", "dev": true, "requires": { "semver": "^6.0.0" @@ -4303,7 +4368,7 @@ "semver": { "version": "6.3.0", "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", - "integrity": "sha1-7gpkyK9ejO6mdoexM3YeG+y9HT0=", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", "dev": true } } @@ -4311,13 +4376,13 @@ "make-error": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/make-error/-/make-error-1.3.6.tgz", - "integrity": "sha1-LrLjfqm2fEiR9oShOUeZr0hM96I=", + "integrity": "sha512-s8UhlNe7vPKomQhC1qFelMokr/Sc3AgNbso3n74mVPA5LTZwkB9NlXf4XPamLxJE8h0gh73rM94xvwRT2CVInw==", "dev": true }, "map-obj": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-4.1.0.tgz", - "integrity": "sha1-uRIhtUJzS58UJWwBMsiXxdclb9U=", + "integrity": "sha512-glc9y00wgtwcDmp7GaE/0b0OnxpNJsVf3ael/An6Fe2Q51LLwN1er6sdomLRzz5h0+yMpiYLhWYF5R7HeqVd4g==", "dev": true }, "marked": { @@ -4333,9 +4398,9 @@ "dev": true }, "meow": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.0.tgz", - "integrity": "sha1-UOy82voW+LWPt+uWdbkz9kc7Olk=", + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/meow/-/meow-7.1.1.tgz", + "integrity": "sha512-GWHvA5QOcS412WCo8vwKDlTelGLsCGBVevQB5Kva961rmNfun0PCbv5+xta2kUMFJyR8/oWnn7ddeKdosbAPbA==", "dev": true, "requires": { "@types/minimist": "^1.2.0", @@ -4354,7 +4419,7 @@ "read-pkg": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-5.2.0.tgz", - "integrity": "sha1-e/KVQ4yloz5WzTDgU7NO5yUMk8w=", + "integrity": "sha512-Ug69mNOpfvKDAc2Q8DRpMjjzdtrnv9HcSMX+4VsZxD1aZ6ZzrIE7rlzXBtWTyhULSMKg076AW6WR5iZpD0JiOg==", "dev": true, "requires": { "@types/normalize-package-data": "^2.4.0", @@ -4366,7 +4431,7 @@ "type-fest": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.6.0.tgz", - "integrity": "sha1-jSojcNPfiG61yQraHFv2GIrPg4s=", + "integrity": "sha512-q+MB8nYR1KDLrgr4G5yemftpMC7/QLqVndBmEEdqzmNj5dcFOO4Oo8qlwZE3ULT3+Zim1F8Kq4cBnikNhlCMlg==", "dev": true } } @@ -4374,7 +4439,7 @@ "read-pkg-up": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-7.0.1.tgz", - "integrity": "sha1-86YTV1hFlzOuK5VjgFbhhU5+9Qc=", + "integrity": "sha512-zK0TB7Xd6JpCLmlLmufqykGE+/TlOePD6qKClNW7hHDKFh/J7/7gCWGR7joEQEW1bKq3a3yUZSObOoWLFQ4ohg==", "dev": true, "requires": { "find-up": "^4.1.0", @@ -4385,7 +4450,7 @@ "type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha1-CeJJ696FHTseSNJ8EFREZn8XuD0=", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true } } @@ -4393,7 +4458,7 @@ "type-fest": { "version": "0.13.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.13.1.tgz", - "integrity": "sha1-AXLLW86AsL1ULqNI21DH4hg02TQ=", + "integrity": "sha512-34R7HTnG0XIJcBSn5XhDd7nNFPRcXYRZrBB2O2jdKqYODldSzBAqzsWoZYYvduky73toYS/ESqxPvkDf/F0XMg==", "dev": true } } @@ -4401,19 +4466,19 @@ "mime": { "version": "2.4.6", "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.6.tgz", - "integrity": "sha1-5bQHyQ20QvK+tbFiNz0Htpr/pNE=", + "integrity": "sha512-RZKhC3EmpBchfTGBVb8fb+RL2cWyw/32lshnsETttkBAyAUXSGHxbEJWWRXc751DrIxG1q04b8QwMbAwkRPpUA==", "dev": true }, "mime-db": { "version": "1.44.0", "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.44.0.tgz", - "integrity": "sha1-+hHF6wrKEzS0Izy01S8QxaYnL5I=", + "integrity": "sha512-/NOTfLrsPBVeH7YtFPgsVWveuL+4SjjYxaQ1xtM1KMFj7HdxlBlxeyNLzhyJVx7r4rZGJAZ/6lkKCitSc/Nmpg==", "dev": true }, "mime-types": { "version": "2.1.27", "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.27.tgz", - "integrity": "sha1-R5SfmOJ56lMRn1ci4PNOUpvsAJ8=", + "integrity": "sha512-JIhqnCasI9yD+SsmkquHBxTSEuZdQX5BuQnS2Vc7puQQQ+8yiP5AY5uWhpdv4YL4VM5c6iliiYWPgJ/nJQLp7w==", "dev": true, "requires": { "mime-db": "1.44.0" @@ -4422,13 +4487,13 @@ "min-indent": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/min-indent/-/min-indent-1.0.1.tgz", - "integrity": "sha1-pj9oFnOzBXH76LwlaGrnRu76mGk=", + "integrity": "sha512-I9jwMn07Sy/IwOj3zVkVik2JTvgpaykDZEigL6Rx6N9LbMywwUSMtxET+7lVoDLLd3O3IXwJwvuuns8UB/HeAg==", "dev": true }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha1-UWbihkV/AzBgZL5Ul+jbsMPTIIM=", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { "brace-expansion": "^1.1.7" @@ -4437,13 +4502,13 @@ "minimist": { "version": "1.2.5", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", - "integrity": "sha1-Z9ZgFLZqaoqqDAg8X9WN9OTpdgI=", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, "minimist-options": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-4.1.0.tgz", - "integrity": "sha1-wGVXE8U6ii69d/+iR9NCxA8BBhk=", + "integrity": "sha512-Q4r8ghd80yhO/0j1O3B2BjweX3fiHg9cdOwjJd2J76Q135c+NDxGCqdYKQ1SKBuFfgWbAUzBfvYjPUEeNgqN1A==", "dev": true, "requires": { "arrify": "^1.0.1", @@ -4454,7 +4519,7 @@ "mkdirp": { "version": "0.5.5", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.5.tgz", - "integrity": "sha1-2Rzv1i0UNsoPQWIOJRKI1CAJne8=", + "integrity": "sha512-NKmAlESf6jMGym1++R0Ra7wvhV+wFW63FaSOFPwRahvea0gMUcGUhVeAg/0BC0wiv9ih5NYPB1Wn1UEI1/L+xQ==", "dev": true, "requires": { "minimist": "^1.2.5" @@ -4463,7 +4528,7 @@ "mocha": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha1-bYrlCPWRZ/lA8rWzxKYSrlDJCuY=", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", "dev": true, "requires": { "browser-stdout": "1.3.1", @@ -4482,28 +4547,22 @@ "commander": { "version": "2.15.1", "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha1-30boZ9D8Kuxmo0ZitAapzK//Ww8=", + "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", "dev": true }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { "ms": "2.0.0" } }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha1-gAwN0eCov7yVg1wgKtIg/jF+WhI=", - "dev": true - }, "glob": { "version": "7.1.2", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha1-wZyd+aAocC1nhhI4SmVSQExjbRU=", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -4538,7 +4597,7 @@ "supports-color": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", - "integrity": "sha1-HGszdALCE3YF7+GfEP7DkPb6q1Q=", + "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -4549,13 +4608,13 @@ "modify-values": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/modify-values/-/modify-values-1.0.1.tgz", - "integrity": "sha1-s5OfpgVUZHTj4+PGPWS9Q7TuYCI=", + "integrity": "sha512-xV2bxeN6F7oYjZWTe/YPAy6MN2M+sL4u/Rlm2AHCIVGfo2p1yGmBHQ6vHehl4bRTZBdHu3TSkWdYgkwpYzAGSw==", "dev": true }, "ms": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", - "integrity": "sha1-0J0fNXtEP0kzgqjrPM0YOHKuYAk=", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", "dev": true }, "natural-compare": { @@ -4567,19 +4626,19 @@ "negotiator": { "version": "0.6.2", "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.2.tgz", - "integrity": "sha1-/qz3zPUlp3rpY0Q2pkiD/+yjRvs=", + "integrity": "sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw==", "dev": true }, "neo-async": { "version": "2.6.2", "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.2.tgz", - "integrity": "sha1-tKr7k+OustgXTKU88WOrfXMIMF8=", + "integrity": "sha512-Yd3UES5mWCSqR+qNT93S3UoYUkqAZ9lLg8a7g9rimsWmYGK8cVToA4/sF3RrshdyV3sAGMXVUmpMYOw+dLpOuw==", "dev": true }, "node-preload": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/node-preload/-/node-preload-0.2.1.tgz", - "integrity": "sha1-wDBDuzJ/QXoY/uerfuV7QIoUQwE=", + "integrity": "sha512-RM5oyBy45cLEoHqCeh+MNuFAxO0vTFBLskvQbOKnEE7YTTSN4tbN8QWDIPQ6L+WvKsB/qLEGpYe2ZZ9d4W9OIQ==", "dev": true, "requires": { "process-on-spawn": "^1.0.0" @@ -4588,13 +4647,13 @@ "node-releases": { "version": "1.1.60", "resolved": "https://registry.npmjs.org/node-releases/-/node-releases-1.1.60.tgz", - "integrity": "sha1-aUi9/OgobwtdDlqI6DhOlU3+cIQ=", + "integrity": "sha512-gsO4vjEdQaTusZAEebUWp2a5d7dF5DYoIpDG7WySnk7BuZDW+GPpHXoXXuYawRBr/9t5q54tirPz79kFIWg4dA==", "dev": true }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", - "integrity": "sha1-5m2xg4sgDB38IzIl0SyzZSDiNKg=", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, "requires": { "hosted-git-info": "^2.1.4", @@ -4606,7 +4665,7 @@ "normalize-path": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha1-Dc1p/yOhybEf0JeDFmRKA4ghamU=", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", "dev": true }, "null-check": { @@ -4624,7 +4683,7 @@ "nyc": { "version": "15.1.0", "resolved": "https://registry.npmjs.org/nyc/-/nyc-15.1.0.tgz", - "integrity": "sha1-EzXa4S3ch7biSdWhmUykva6nXwI=", + "integrity": "sha512-jMW04n9SxKdKi1ZMGhvUTHBN0EICCRkHemEoE5jm6mTYcqcdas0ATzgUgejlQUHMvpnOZqGB5Xxsv9KxJW1j8A==", "dev": true, "requires": { "@istanbuljs/load-nyc-config": "^1.0.0", @@ -4659,7 +4718,7 @@ "resolve-from": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", - "integrity": "sha1-w1IlhD3493bfIcV1V7wIfp39/Gk=", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", "dev": true } } @@ -4679,13 +4738,13 @@ "object-keys": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", - "integrity": "sha1-HEfyct8nfzsdrwYWd9nILiMixg4=", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, "object.assign": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", - "integrity": "sha1-lovxEA15Vrs8oIbwBvhGs7xACNo=", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", "dev": true, "requires": { "define-properties": "^1.1.2", @@ -4715,7 +4774,7 @@ "optionator": { "version": "0.9.1", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.9.1.tgz", - "integrity": "sha1-TyNqY3Pa4FZqbUPhMmZ09QwpFJk=", + "integrity": "sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw==", "dev": true, "requires": { "deep-is": "^0.1.3", @@ -4729,7 +4788,7 @@ "p-limit": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", - "integrity": "sha1-PdM8ZHohT9//2DWTPrCG2g3CHbE=", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -4738,7 +4797,7 @@ "p-locate": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", - "integrity": "sha1-o0KLtwiLOmApL2aRkni3wpetTwc=", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", "dev": true, "requires": { "p-limit": "^2.2.0" @@ -4747,7 +4806,7 @@ "p-map": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/p-map/-/p-map-3.0.0.tgz", - "integrity": "sha1-1wTZr4orpoTiYA2aIVmD1BQal50=", + "integrity": "sha512-d3qXVTF/s+W+CdJ5A29wywV2n8CQQYahlgz2bFiA+4eVNJbHJodPZ+/gXwPGh0bOqA+j8S+6+ckmvLGPk1QpxQ==", "dev": true, "requires": { "aggregate-error": "^3.0.0" @@ -4756,13 +4815,13 @@ "p-try": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", - "integrity": "sha1-yyhoVA4xPWHeWPr741zpAE1VQOY=", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", "dev": true }, "package-hash": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", - "integrity": "sha1-NTf2VGZew8w4gnOH/JBMFjxU9QY=", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", "dev": true, "requires": { "graceful-fs": "^4.1.15", @@ -4774,7 +4833,7 @@ "parent-module": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", - "integrity": "sha1-aR0nCeeMefrjoVZiJFLQB2LKqqI=", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", "dev": true, "requires": { "callsites": "^3.0.0" @@ -4789,7 +4848,7 @@ "parse-json": { "version": "5.1.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", - "integrity": "sha1-+WCIzfJKj6qa6poAny2dlCyZlkY=", + "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -4819,13 +4878,13 @@ "parseurl": { "version": "1.3.3", "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", - "integrity": "sha1-naGee+6NEt/wUT7Vt2lXeTvC6NQ=", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", "dev": true }, "path-exists": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha1-UTvb4tO5XXdi6METfvoZXGxhtbM=", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", "dev": true }, "path-is-absolute": { @@ -4837,13 +4896,13 @@ "path-key": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha1-WB9q3mWMu6ZaDTOA3ndTKVBU83U=", + "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", "dev": true }, "path-parse": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha1-1i27VnlAXXLEc37FhgDp3c8G0kw=", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, "path-type": { @@ -4866,7 +4925,7 @@ "picomatch": { "version": "2.2.2", "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", - "integrity": "sha1-IfMz6ba46v8CRo9RRupAbTRfTa0=", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", "dev": true }, "pify": { @@ -4893,7 +4952,7 @@ "pkg-dir": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", - "integrity": "sha1-8JkTPfft5CLoHR2ESCcO6z5CYfM=", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", "dev": true, "requires": { "find-up": "^4.0.0" @@ -4902,25 +4961,25 @@ "platform": { "version": "1.3.6", "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", - "integrity": "sha1-SLTOmDFksgnC1FoQetsx9HOm56c=", + "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==", "dev": true }, "prelude-ls": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.2.1.tgz", - "integrity": "sha1-3rxkidem5rDnYRiIzsiAM30xY5Y=", + "integrity": "sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g==", "dev": true }, "prettier": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.1.tgz", - "integrity": "sha1-2Uhd1eSZ2qbLVHAjuHps9RvuN9Y=", + "integrity": "sha512-9bY+5ZWCfqj3ghYBLxApy2zf6m+NJo5GzmLTpr9FsApsfjriNnS2dahWReHMi7qNPhhHl9SYHJs2cHZLgexNIw==", "dev": true }, "prettier-linter-helpers": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/prettier-linter-helpers/-/prettier-linter-helpers-1.0.0.tgz", - "integrity": "sha1-0j1B/hN1ZG3i0BBNNFSjAIgCz3s=", + "integrity": "sha512-GbK2cP9nraSSUF9N2XwUwqfzlAFlMNYYl+ShE/V+H8a9uNl/oUqB1w2EL54Jh0OlyRSd8RfWYJ3coVS4TROP2w==", "dev": true, "requires": { "fast-diff": "^1.1.2" @@ -4935,13 +4994,13 @@ "process-nextick-args": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", - "integrity": "sha1-eCDZsWEgzFXKmud5JoCufbptf+I=", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", "dev": true }, "process-on-spawn": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/process-on-spawn/-/process-on-spawn-1.0.0.tgz", - "integrity": "sha1-lbBaIwc9MKF6z9ySpEDv0rrv3JM=", + "integrity": "sha512-1WsPDsUSMmZH5LeMLegqkPDrsGgsWwk1Exipy2hvB0o/F0ASzbpIctSCcZIK1ykJvtTJULEH+20WOFjMvGnCTg==", "dev": true, "requires": { "fromentries": "^1.2.0" @@ -4950,13 +5009,13 @@ "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", - "integrity": "sha1-foz42PW48jnBvGi+tOt4Vn1XLvg=", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", "dev": true }, "punycode": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha1-tYsBCsQMIsVldhbI0sLALHv0eew=", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, "q": { @@ -4968,31 +5027,31 @@ "qjobs": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/qjobs/-/qjobs-1.2.0.tgz", - "integrity": "sha1-xF6cYYAL0IfviNfiVkI73Unl0HE=", + "integrity": "sha512-8YOJEHtxpySA3fFDyCRxA+UUV+fA+rTWnuWvylOK/NCjhY+b4ocCtmu8TtsWb+mYeU+GCHf/S66KZF/AsteKHg==", "dev": true }, "qs": { "version": "6.7.0", "resolved": "https://registry.npmjs.org/qs/-/qs-6.7.0.tgz", - "integrity": "sha1-QdwaAV49WB8WIXdr4xr7KHapsbw=", + "integrity": "sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ==", "dev": true }, "quick-lru": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-4.0.1.tgz", - "integrity": "sha1-W4h48ROlgheEjGSCAmxz4bpXcn8=", + "integrity": "sha512-ARhCpm70fzdcvNQfPoy49IaanKkTlRWF2JMzqhcJbhSFRZv7nPTvZJdcY7301IPmvW+/p0RgIWnQDLJxifsQ7g==", "dev": true }, "range-parser": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", - "integrity": "sha1-PPNwI9GZ4cJNGlW4SADC8+ZGgDE=", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", "dev": true }, "raw-body": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.4.0.tgz", - "integrity": "sha1-oc5vucm8NWylLoklarWQWeE9AzI=", + "integrity": "sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q==", "dev": true, "requires": { "bytes": "3.1.0", @@ -5037,7 +5096,7 @@ "path-type": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", - "integrity": "sha1-zvMdyOCho7sNEFwM2Xzzv0f0428=", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", "dev": true, "requires": { "pify": "^3.0.0" @@ -5089,7 +5148,7 @@ "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha1-uGvV8MJWkJEcdZD8v8IBDVSzzLg=", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, "requires": { "p-try": "^1.0.0" @@ -5121,7 +5180,7 @@ "readable-stream": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", - "integrity": "sha1-M3u9o63AcGvT4CRCaihtS0sskZg=", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", "dev": true, "requires": { "inherits": "^2.0.3", @@ -5132,7 +5191,7 @@ "readdirp": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.4.0.tgz", - "integrity": "sha1-n9zN+ekVWAVEkiGsZF6DA6tbmto=", + "integrity": "sha512-0xe001vZBnJEK+uKcj8qOhyAKPzIT+gStxWr3LCB0DwcXR5NZJ3IaC+yGnHCYzB/S7ov3m3EEbZI2zeNvX+hGQ==", "dev": true, "requires": { "picomatch": "^2.2.1" @@ -5150,7 +5209,7 @@ "redent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/redent/-/redent-3.0.0.tgz", - "integrity": "sha1-5Ve3mYMWu1PJ8fVvpiY1LGljBZ8=", + "integrity": "sha512-6tDA8g98We0zd0GvVeMT9arEOnTw9qM03L9cJXaCjrip1OO764RDBLBfrB4cwzNGDj5OA5ioymC9GkizgWJDUg==", "dev": true, "requires": { "indent-string": "^4.0.0", @@ -5160,13 +5219,13 @@ "regenerate": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.1.tgz", - "integrity": "sha1-ytkq2Oa1kXc0hfvgWkhcr09Ffm8=", + "integrity": "sha512-j2+C8+NtXQgEKWk49MMP5P/u2GhnahTtVkRIHr5R5lVRlbKvmQ+oS+A5aLKWp2ma5VkT8sh6v+v4hbH0YHR66A==", "dev": true }, "regenerate-unicode-properties": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.2.0.tgz", - "integrity": "sha1-5d5xEdZV57pgwFfb6f83yH5lzew=", + "integrity": "sha512-F9DjY1vKLo/tPePDycuH3dn9H1OTPIkVD9Kz4LODu+F2C75mgjAJ7x/gwy6ZcSNRAAkhNlJSOHRe8k3p+K9WhA==", "dev": true, "requires": { "regenerate": "^1.4.0" @@ -5175,13 +5234,13 @@ "regenerator-runtime": { "version": "0.13.7", "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.13.7.tgz", - "integrity": "sha1-ysLazIoepnX+qrrriugziYrkb1U=", + "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", "dev": true }, "regenerator-transform": { "version": "0.14.5", "resolved": "https://registry.npmjs.org/regenerator-transform/-/regenerator-transform-0.14.5.tgz", - "integrity": "sha1-yY2hVGg2ccnE3LFuznNlF+G3/rQ=", + "integrity": "sha512-eOf6vka5IO151Jfsw2NO9WpGX58W6wWmefK3I1zEGr0lOD0u8rwPaNqQL1aRxUaxLeKO3ArNh3VYg1KbaD+FFw==", "dev": true, "requires": { "@babel/runtime": "^7.8.4" @@ -5190,13 +5249,13 @@ "regexpp": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-3.1.0.tgz", - "integrity": "sha1-IG0K0KVkjP+9uK5GQ489xRyfeOI=", + "integrity": "sha512-ZOIzd8yVsQQA7j8GCSlPGXwg5PfmA1mrq0JP4nGhh54LaKN3xdai/vHUDu74pKwV8OxseMS65u2NImosQcSD0Q==", "dev": true }, "regexpu-core": { "version": "4.7.0", "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.7.0.tgz", - "integrity": "sha1-/L9FjFBDGwu3tF1pZ7gZLZHz2Tg=", + "integrity": "sha512-TQ4KXRnIn6tz6tjnrXEkD/sshygKH/j5KzK86X8MkeHyZ8qst/LZ89j3X4/8HEIfHANTFIP/AbXakeRhWIl5YQ==", "dev": true, "requires": { "regenerate": "^1.4.0", @@ -5210,13 +5269,13 @@ "regjsgen": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.2.tgz", - "integrity": "sha1-kv8pX7He7L9uzaslQ9IH6RqjNzM=", + "integrity": "sha512-OFFT3MfrH90xIW8OOSyUrk6QHD5E9JOTeGodiJeBS3J6IwlgzJMNE/1bZklWz5oTg+9dCMyEetclvCVXOPoN3A==", "dev": true }, "regjsparser": { "version": "0.6.4", "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.4.tgz", - "integrity": "sha1-p2n4aEMIQBpm6bUp0kNv9NBmYnI=", + "integrity": "sha512-64O87/dPDgfk8/RQqC4gkZoGyyWFIEUTTh80CU6CWuK5vkCGyekIx+oKcEIYtP/RAxSQltCZHCNu/mdd7fqlJw==", "dev": true, "requires": { "jsesc": "~0.5.0" @@ -5257,7 +5316,7 @@ "require-main-filename": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", - "integrity": "sha1-0LMp7MfMD2Fkn2IhW+aa9UqomJs=", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, "requires-port": { @@ -5269,7 +5328,7 @@ "resolve": { "version": "1.17.0", "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.17.0.tgz", - "integrity": "sha1-sllBtUloIxzC0bt2p5y38sC/hEQ=", + "integrity": "sha512-ic+7JYiV8Vi2yzQGFWOkiZD5Z9z7O2Zhm9XMaTxdJExKasieFCr+yXZ/WmXsckHiKl12ar0y6XiXDx3m4RHn1w==", "dev": true, "requires": { "path-parse": "^1.0.6" @@ -5278,28 +5337,28 @@ "resolve-from": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", - "integrity": "sha1-SrzYUq0y3Xuqv+m0DgCjbbXzkuY=", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, "rfdc": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.1.4.tgz", - "integrity": "sha1-unLME2egzNnPgahws7WL060H+MI=", + "integrity": "sha512-5C9HXdzK8EAqN7JDif30jqsBzavB7wLpaubisuQIGHWf2gUXSpzy6ArX/+Da8RjFpagWsCn+pIgxTMAmKw9Zug==", "dev": true }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", - "integrity": "sha1-8aVAK6YiCtUswSgrrBrjqkn9Bho=", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", "dev": true, "requires": { "glob": "^7.1.3" } }, "rollup": { - "version": "2.26.5", - "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.26.5.tgz", - "integrity": "sha1-VWLsNvy6Pu1lz9YwvXjgN60OAwc=", + "version": "2.26.11", + "resolved": "https://registry.npmjs.org/rollup/-/rollup-2.26.11.tgz", + "integrity": "sha512-xyfxxhsE6hW57xhfL1I+ixH8l2bdoIMaAecdQiWF3N7IgJEMu99JG+daBiSZQjnBpzFxa0/xZm+3pbCdAQehHw==", "dev": true, "requires": { "fsevents": "~2.1.2" @@ -5308,7 +5367,7 @@ "rollup-plugin-inject": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rollup-plugin-inject/-/rollup-plugin-inject-3.0.2.tgz", - "integrity": "sha1-5CM4Vb+6bAwSoxL9Zknf+aE+6fQ=", + "integrity": "sha512-ptg9PQwzs3orn4jkgXJ74bfs5vYz1NCZlSQMBUA0wKcGp5i5pA1AO3fOUEte8enhGUC+iapTCzEWw2jEFFUO/w==", "dev": true, "requires": { "estree-walker": "^0.6.1", @@ -5319,7 +5378,7 @@ "estree-walker": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", - "integrity": "sha1-UwSRQ/QMbrkYsjZx0f4yGfOhs2I=", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", "dev": true } } @@ -5327,7 +5386,7 @@ "rollup-plugin-node-globals": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/rollup-plugin-node-globals/-/rollup-plugin-node-globals-1.4.0.tgz", - "integrity": "sha1-Xh8kqbuXwO9RJJ9iXhbH5ht8Ags=", + "integrity": "sha512-xRkB+W/m1KLIzPUmG0ofvR+CPNcvuCuNdjVBVS7ALKSxr3EDhnzNceGkGi1m8MToSli13AzKFYH4ie9w3I5L3g==", "dev": true, "requires": { "acorn": "^5.7.3", @@ -5341,19 +5400,19 @@ "acorn": { "version": "5.7.4", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.4.tgz", - "integrity": "sha1-Po2KmUfQWZoXltECJddDL0pKz14=", + "integrity": "sha512-1D++VG7BhrtvQpNbBzovKNc1FLGGEE/oGe7b9xJm/RFHMBeUaUGpluV9RLjZa47YFdPcDAenEYuq9pQPcMdLJg==", "dev": true }, "estree-walker": { "version": "0.5.2", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.5.2.tgz", - "integrity": "sha1-04UL51KclYDYFWALUxJlFeFG3Tk=", + "integrity": "sha512-XpCnW/AE10ws/kDAs37cngSkvgIR8aN3G0MS85m7dUpuK2EREo9VJ00uvw6Dg/hXEpfsE1I1TvJOJr+Z+TL+ig==", "dev": true }, "magic-string": { "version": "0.22.5", "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.22.5.tgz", - "integrity": "sha1-jpz1r930Q4XB2lvCpqDb0QsDZX4=", + "integrity": "sha512-oreip9rJZkzvA8Qzk9HFs8fZGF/u7H/gtrE8EN6RjKJ9kh2HlC+yQ2QezifqTZfGyiuAV0dRv5a+y/8gBb1m9w==", "dev": true, "requires": { "vlq": "^0.2.2" @@ -5364,7 +5423,7 @@ "rollup-plugin-node-polyfills": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/rollup-plugin-node-polyfills/-/rollup-plugin-node-polyfills-0.2.1.tgz", - "integrity": "sha1-UwkqJ0SDcWTVuKKIErpfP/YRCf0=", + "integrity": "sha512-4kCrKPTJ6sK4/gLL/U5QzVT8cxJcofO0OU74tnB19F40cmuAKSzH5/siithxlofFEjwvw1YAhPmbvGNA6jEroA==", "dev": true, "requires": { "rollup-plugin-inject": "^3.0.0" @@ -5373,7 +5432,7 @@ "rollup-pluginutils": { "version": "2.8.2", "resolved": "https://registry.npmjs.org/rollup-pluginutils/-/rollup-pluginutils-2.8.2.tgz", - "integrity": "sha1-cvKvB0i1kjZNvTOJ5gDlqURKNR4=", + "integrity": "sha512-EEp9NhnUkwY8aif6bxgovPHMoMoNr2FulJziTndpt5H9RdwC47GSGuII9XxpSdzVGM0GWrNPHV6ie1LTNJPaLQ==", "dev": true, "requires": { "estree-walker": "^0.6.1" @@ -5382,27 +5441,27 @@ "estree-walker": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/estree-walker/-/estree-walker-0.6.1.tgz", - "integrity": "sha1-UwSRQ/QMbrkYsjZx0f4yGfOhs2I=", + "integrity": "sha512-SqmZANLWS0mnatqbSfRP5g8OXZC12Fgg1IwNtLsyHDzJizORW4khDfjPqJZsemPWBB2uqykUah5YpQ6epsqC/w==", "dev": true } } }, "safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha1-Hq+fqb2x/dTsdfWPnNtOa3gn7sY=", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", "dev": true }, "safer-buffer": { "version": "2.1.2", "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", - "integrity": "sha1-RPoWGwGHuVSd2Eu5GAL5vYOFzWo=", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, "semver": { "version": "5.7.1", "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.1.tgz", - "integrity": "sha1-qVT5Ma66UI0we78Gnv8MAclhFvc=", + "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, "set-blocking": { @@ -5414,13 +5473,13 @@ "setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", - "integrity": "sha1-fpWsskqpL1iF4KvvW6ExMw1K5oM=", + "integrity": "sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw==", "dev": true }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha1-zNCvT4g1+9wmW4JGGq8MNmY/NOo=", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", "dev": true, "requires": { "shebang-regex": "^3.0.0" @@ -5429,13 +5488,13 @@ "shebang-regex": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha1-rhbxZE2HPsrYQ7AwexQzYtTEIXI=", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", "dev": true }, "shelljs": { "version": "0.8.4", "resolved": "https://registry.npmjs.org/shelljs/-/shelljs-0.8.4.tgz", - "integrity": "sha1-3naE/ut2f4cWsyYHiooAh1iQ48I=", + "integrity": "sha512-7gk3UZ9kOfPLIAbslLzyWeGiEqx9e3rxwZM0KE6EL8GlGwjym9Mrlx5/p33bWTu9YG6vcS4MBxYZDHYr5lr8BQ==", "dev": true, "requires": { "glob": "^7.0.0", @@ -5446,13 +5505,13 @@ "signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha1-oUEMLt2PB3sItOJTyOrPyvBXRhw=", + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", "dev": true }, "slice-ansi": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", - "integrity": "sha1-ys12k0YaY3pXiNkqfdT7oGjoFjY=", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", "dev": true, "requires": { "ansi-styles": "^3.2.0", @@ -5463,7 +5522,7 @@ "socket.io": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/socket.io/-/socket.io-2.3.0.tgz", - "integrity": "sha1-zXYu1qT67KWbwfPiQ8CWkxHrc/s=", + "integrity": "sha512-2A892lrj0GcgR/9Qk81EaY2gYhCBxurV0PfmmESO6p27QPrUK1J3zdns+5QPqvUYK2q657nSj0guoIil9+7eFg==", "dev": true, "requires": { "debug": "~4.1.0", @@ -5477,13 +5536,13 @@ "socket.io-adapter": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/socket.io-adapter/-/socket.io-adapter-1.1.2.tgz", - "integrity": "sha1-qz8Nb2a4/H/KOVmrWZH4IiF4m+k=", + "integrity": "sha512-WzZRUj1kUjrTIrUKpZLEzFZ1OLj5FwLlAFQs9kuZJzJi5DKdU7FsWc36SNmA8iDOtwBQyT8FkrriRM8vXLYz8g==", "dev": true }, "socket.io-client": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/socket.io-client/-/socket.io-client-2.3.0.tgz", - "integrity": "sha1-FNW6LgC5vNFFrkQ6uWs/hsvMG7Q=", + "integrity": "sha512-cEQQf24gET3rfhxZ2jJ5xzAOo/xhZwK+mOqtGRg5IowZsMgwvHwnf/mCRapAAkadhM26y+iydgwsXGObBB5ZdA==", "dev": true, "requires": { "backo2": "1.0.2", @@ -5511,7 +5570,7 @@ "socket.io-parser": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.3.0.tgz", - "integrity": "sha1-K1KpalCf3zFEC6QP7WCUx9TxJi8=", + "integrity": "sha512-hczmV6bDgdaEbVqhAeVMM/jfUfzuEZHsQg6eOmLgJht6G3mPKMxYm75w2+qhAQZ+4X+1+ATZ+QFKeOZD5riHng==", "dev": true, "requires": { "component-emitter": "1.2.1", @@ -5522,7 +5581,7 @@ "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", - "integrity": "sha1-W7WgZyYotkFJVmuhaBnmFRjGcmE=", + "integrity": "sha512-OX8XqP7/1a9cqkxYw2yXss15f26NKWBpDXQd0/uK/KPqdQhxbPa994hnzjcE2VqQpDslf55723cKPUOGSmMY3g==", "dev": true, "requires": { "ms": "2.0.0" @@ -5535,7 +5594,7 @@ "socket.io-parser": { "version": "3.4.1", "resolved": "https://registry.npmjs.org/socket.io-parser/-/socket.io-parser-3.4.1.tgz", - "integrity": "sha1-sGr4ODApdYN+qy3JgAN9okBU1ko=", + "integrity": "sha512-11hMgzL+WCLWf1uFtHSNvliI++tcRUWdoeYuwIl+Axvwy9z2gQM+7nJyN3STj1tLj5JyIUH8/gpDGxzAlDdi0A==", "dev": true, "requires": { "component-emitter": "1.2.1", @@ -5552,7 +5611,7 @@ "source-map-support": { "version": "0.5.19", "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.19.tgz", - "integrity": "sha1-qYti+G3K9PZzmWSMCFKRq56P7WE=", + "integrity": "sha512-Wonm7zOCIJzBGQdB+thsPar0kYuCIzYvxZwlBa87yi/Mdjv7Tip2cyVbLj5o0cFPN4EVkuTwb3GDDyUx2DGnGw==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -5562,7 +5621,7 @@ "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha1-dHIq8y6WFOnCh6jQu95IteLxomM=", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", "dev": true } } @@ -5570,13 +5629,13 @@ "sourcemap-codec": { "version": "1.4.8", "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", - "integrity": "sha1-6oBL2UhXQC5pktBaOO8a41qatMQ=", + "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", "dev": true }, "spawn-wrap": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/spawn-wrap/-/spawn-wrap-2.0.0.tgz", - "integrity": "sha1-EDaFuLj5t5dxMYgnqnhlCmENRX4=", + "integrity": "sha512-EeajNjfN9zMnULLwhZZQU3GWBoFNkbngTUPfaawT4RkMiviTxcX0qfhVbGey39mfctfDHkWtuecgQ8NJcyQWHg==", "dev": true, "requires": { "foreground-child": "^2.0.0", @@ -5590,7 +5649,7 @@ "spdx-correct": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.1.tgz", - "integrity": "sha1-3s6BrJweZxPl99G28X1Gj6U9iak=", + "integrity": "sha512-cOYcUWwhCuHCXi49RhFRCyJEK3iPj1Ziz9DpViV3tbZOwXD49QzIN3MpOLJNxh2qwq2lJJZaKMVw9qNi4jTC0w==", "dev": true, "requires": { "spdx-expression-parse": "^3.0.0", @@ -5600,13 +5659,13 @@ "spdx-exceptions": { "version": "2.3.0", "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.3.0.tgz", - "integrity": "sha1-PyjOGnegA3JoPq3kpDMYNSeiFj0=", + "integrity": "sha512-/tTrYOC7PPI1nUAgx34hUpqXuyJG+DTHJTnIULG4rDygi4xu/tfgmq1e1cIRwRzwZgo4NLySi+ricLkZkw4i5A==", "dev": true }, "spdx-expression-parse": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.1.tgz", - "integrity": "sha1-z3D1BILu/cmOPOCmgz5KU87rpnk=", + "integrity": "sha512-cbqHunsQWnJNE6KhVSMsMeH5H/L9EpymbzqTQ3uLwNCLZ1Q481oWaofqH7nO6V07xlXwY6PhQdQ2IedWx/ZK4Q==", "dev": true, "requires": { "spdx-exceptions": "^2.1.0", @@ -5616,13 +5675,13 @@ "spdx-license-ids": { "version": "3.0.5", "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.5.tgz", - "integrity": "sha1-NpS1gEVnpFjTyARYQqY1hjL2JlQ=", + "integrity": "sha512-J+FWzZoynJEXGphVIS+XEh3kFSjZX/1i9gFBaWQcB+/tmpe2qUsSBABpcxqxnAxFdiUFEgAX1bjYGQvIZmoz9Q==", "dev": true }, "split": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/split/-/split-1.0.1.tgz", - "integrity": "sha1-YFvZvjA6pZ+zX5Ip++oN3snqB9k=", + "integrity": "sha512-mTyOoPbrivtXnwnIxZRFYRrPNtEFKlpB2fvjSnCQUiAA6qAZzqwna5envK4uk6OIeP17CsdF3rSBGYVBsU0Tkg==", "dev": true, "requires": { "through": "2" @@ -5631,7 +5690,7 @@ "split2": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/split2/-/split2-2.2.0.tgz", - "integrity": "sha1-GGsldbz4PoW30YRldWI47k7kJJM=", + "integrity": "sha512-RAb22TG39LhI31MbreBgIuKiIKhVsawfTgEGqKHTK87aG+ul/PB8Sqoi3I7kVdRWiCfrKxK3uo4/YUkpNvhPbw==", "dev": true, "requires": { "through2": "^2.0.2" @@ -5646,7 +5705,7 @@ "readable-stream": { "version": "2.3.7", "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", - "integrity": "sha1-Hsoc9xGu+BTAT2IlKjamL2yyO1c=", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", "dev": true, "requires": { "core-util-is": "~1.0.0", @@ -5658,16 +5717,10 @@ "util-deprecate": "~1.0.1" } }, - "safe-buffer": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", - "integrity": "sha1-mR7GnSluAxN0fVm9/St0XDX4go0=", - "dev": true - }, "string_decoder": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", - "integrity": "sha1-nPFhG6YmhdcDCunkujQUnDrwP8g=", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", "dev": true, "requires": { "safe-buffer": "~5.1.0" @@ -5676,7 +5729,7 @@ "through2": { "version": "2.0.5", "resolved": "https://registry.npmjs.org/through2/-/through2-2.0.5.tgz", - "integrity": "sha1-AcHjnrMdB8t9A6lqcIIyYLIxMs0=", + "integrity": "sha512-/mrRod8xqpA+IHSLyGCQ2s8SPHiCDEeQJSep1jqLYeEUClOFG2Qsh+4FU6G9VeqpZnGW/Su8LQGc4YKni5rYSQ==", "dev": true, "requires": { "readable-stream": "~2.3.6", @@ -5694,7 +5747,7 @@ "standard-version": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/standard-version/-/standard-version-8.0.2.tgz", - "integrity": "sha1-Au1xMfgwRr0ENY3FT5fULEsv2Cg=", + "integrity": "sha512-L8X9KFq2SmVmaeZgUmWHFJMOsEWpjgFAwqic6yIIoveM1kdw1vH4Io03WWxUDjypjGqGU6qUtcJoR8UvOv5w3g==", "dev": true, "requires": { "chalk": "^2.4.2", @@ -5717,7 +5770,7 @@ "semver": { "version": "7.3.2", "resolved": "https://registry.npmjs.org/semver/-/semver-7.3.2.tgz", - "integrity": "sha1-YElisFK4HtB4aq6EOJ/7pw/9OTg=", + "integrity": "sha512-OrOb32TeeambH6UrhtShmF7CRDqhL6/5XpPNp2DuRH6+9QLw/orhp72j87v8Qa1ScDkvrrBNpZcDejAirJmfXQ==", "dev": true } } @@ -5731,7 +5784,7 @@ "streamroller": { "version": "2.2.4", "resolved": "https://registry.npmjs.org/streamroller/-/streamroller-2.2.4.tgz", - "integrity": "sha1-wZjO1C25QIamGTYIGHzoCl8rDlM=", + "integrity": "sha512-OG79qm3AujAM9ImoqgWEY1xG4HX+Lw+yY6qZj9R1K2mhF5bEmQ849wvrb+4vt4jLMLzwXttJlQbOdPOQVRv7DQ==", "dev": true, "requires": { "date-format": "^2.1.0", @@ -5742,13 +5795,13 @@ "date-format": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/date-format/-/date-format-2.1.0.tgz", - "integrity": "sha1-MdW16iEc9f12TNOLr50DPffhJc8=", + "integrity": "sha512-bYQuGLeFxhkxNOF3rcMtiZxvCBAquGzZm6oWA1oZ0g2THUzivaRhv8uOhdr19LmoobSOLoIAxeUK2RdbM8IFTA==", "dev": true }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha1-SdQ8RaiM2Wd2aMt74bRu/bjS4cA=", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "dev": true, "requires": { "graceful-fs": "^4.2.0", @@ -5761,13 +5814,13 @@ "string-argv": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", - "integrity": "sha1-leL77AQnrhkYSTX4FtdKqkxcGdo=", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", "dev": true }, "string-width": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", - "integrity": "sha1-InZ74htirxCBV0MG9prFG2IgOWE=", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", "dev": true, "requires": { "emoji-regex": "^7.0.1", @@ -5778,13 +5831,13 @@ "ansi-regex": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", - "integrity": "sha1-i5+PCM8ay4Q3Vqg5yox+MWjFGZc=", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "strip-ansi": { "version": "5.2.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", - "integrity": "sha1-jJpTb+tq/JYr36WxBKUJHBrZwK4=", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", "dev": true, "requires": { "ansi-regex": "^4.1.0" @@ -5795,22 +5848,30 @@ "string_decoder": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha1-QvEUWUpGzxqOMLCoT1bHjD7awh4=", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", "dev": true, "requires": { "safe-buffer": "~5.2.0" + }, + "dependencies": { + "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==", + "dev": true + } } }, "stringify-package": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/stringify-package/-/stringify-package-1.0.1.tgz", - "integrity": "sha1-5ao2Q+f3TQ8oYoty89rVzs/DuoU=", + "integrity": "sha512-sa4DUQsYciMP1xhKWGuFM04fB0LG/9DlluZoSVywUMRNvzid6XucHK0/90xGxRoHrAaROrcHK1aPKaijCtSrhg==", "dev": true }, "strip-ansi": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", - "integrity": "sha1-CxVx3XZpzNTz4G4U7x7tJiJa5TI=", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", "dev": true, "requires": { "ansi-regex": "^5.0.0" @@ -5819,13 +5880,13 @@ "strip-bom": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-4.0.0.tgz", - "integrity": "sha1-nDUFwdtFvO3KPZz3oW9cWqOQGHg=", + "integrity": "sha512-3xurFv5tEgii33Zi8Jtp55wEIILR9eh34FAW00PZf+JnSsTmV/ioewSgQl97JHvgjoRGwPShsWm+IdrxB35d0w==", "dev": true }, "strip-indent": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-3.0.0.tgz", - "integrity": "sha1-wy4c7pQLazQyx3G8LFS8znPNMAE=", + "integrity": "sha512-laJTa3Jb+VQpaC6DseHhF7dXVqHTfJPCRDaEbid/drOhgitgYku/letMUqOXFoWV0zIIUbjpdH2t+tYj4bQMRQ==", "dev": true, "requires": { "min-indent": "^1.0.0" @@ -5834,13 +5895,13 @@ "strip-json-comments": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha1-MfEoGzgyYwQ0gxwxDAHMzajL4AY=", + "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", "dev": true }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", - "integrity": "sha1-4uaaRKyHcveKHsCzW2id9lMO/I8=", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", "dev": true, "requires": { "has-flag": "^3.0.0" @@ -5849,7 +5910,7 @@ "table": { "version": "5.4.6", "resolved": "https://registry.npmjs.org/table/-/table-5.4.6.tgz", - "integrity": "sha1-EpLRlQDOP4YFOwXw6Ofko7shB54=", + "integrity": "sha512-wmEc8m4fjnob4gt5riFRtTu/6+4rSe12TpAELNSqHMfF3IqnA+CH37USM6/YR3qRZv7e56kAEAtd6nKZaxe0Ug==", "dev": true, "requires": { "ajv": "^6.10.2", @@ -5861,7 +5922,7 @@ "test-exclude": { "version": "6.0.0", "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-6.0.0.tgz", - "integrity": "sha1-BKhphmHYBepvopO2y55jrARO8V4=", + "integrity": "sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w==", "dev": true, "requires": { "@istanbuljs/schema": "^0.1.2", @@ -5872,7 +5933,7 @@ "text-extensions": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/text-extensions/-/text-extensions-1.9.0.tgz", - "integrity": "sha1-GFPkX+45yUXOb2w2stZZtaq8KiY=", + "integrity": "sha512-wiBrwC1EhBelW12Zy26JeOUkQ5mRu+5o8rpsJk5+2t+Y5vE7e842qtZDQ2g1NpX/29HdyFeJ4nSIhI47ENSxlQ==", "dev": true }, "text-table": { @@ -5890,7 +5951,7 @@ "through2": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/through2/-/through2-3.0.2.tgz", - "integrity": "sha1-mfiJMc/HYex2eLQdXXM2tbage/Q=", + "integrity": "sha512-enaDQ4MUyP2W6ZyT6EsMzqBPZaM/avg8iuo+l2d3QCs0J+6RaqkHV/2/lOwDTueBHeJ/2LG9lrLW3d5rWPucuQ==", "dev": true, "requires": { "inherits": "^2.0.4", @@ -5906,7 +5967,7 @@ "tmp": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.1.tgz", - "integrity": "sha1-hFf8MDfc9HGcJRNnoa9lAO4czxQ=", + "integrity": "sha512-76SUhtfqR2Ijn+xllcI5P1oyannHNHByD80W1q447gU3mp9G9PSpGdWmjUOHRDPiHYacIk66W7ubDTuPF3BEtQ==", "dev": true, "requires": { "rimraf": "^3.0.0" @@ -5927,7 +5988,7 @@ "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha1-FkjESq58jZiKMmAY7XL1tN0DkuQ=", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", "dev": true, "requires": { "is-number": "^7.0.0" @@ -5936,13 +5997,13 @@ "toidentifier": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.0.tgz", - "integrity": "sha1-fhvjRw8ed5SLxD2Uo8j013UrpVM=", + "integrity": "sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw==", "dev": true }, "trim-newlines": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-3.0.0.tgz", - "integrity": "sha1-eXJjBKaomKqDc0JymNVMLuixyzA=", + "integrity": "sha512-C4+gOpvmxaSMKuEf9Qc134F1ZuOHVXKRbtEflf4NTtuuJDEIJ9p5PXsalL8SkeRw+qit1Mo+yuvMPAKwWg/1hA==", "dev": true }, "trim-off-newlines": { @@ -5954,7 +6015,7 @@ "ts-node": { "version": "9.0.0", "resolved": "https://registry.npmjs.org/ts-node/-/ts-node-9.0.0.tgz", - "integrity": "sha1-52mdKhEMyMDTuDFxXkF2iGg0YLM=", + "integrity": "sha512-/TqB4SnererCDR/vb4S/QvSZvzQMJN8daAslg7MeaiHvD8rDZsSfXmNeNumyZZzMned72Xoq/isQljYSt8Ynfg==", "dev": true, "requires": { "arg": "^4.1.0", @@ -5962,34 +6023,35 @@ "make-error": "^1.1.1", "source-map-support": "^0.5.17", "yn": "3.1.1" + }, + "dependencies": { + "diff": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", + "integrity": "sha512-58lmxKSA4BNyLz+HHMUzlOEpg09FV+ev6ZMe3vJihgdxzgcwZ8VoEEPmALCZG9LmqfVoNMMKpttIYTVG6uDY7A==", + "dev": true + } } }, "tslib": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.0.1.tgz", - "integrity": "sha1-QQ6w0RPltjVkkO7HSWA3JbAhtD4=" + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", + "integrity": "sha512-i/6DQjL8Xf3be4K/E6Wgpekn5Qasl1usyw++dAA35Ue5orEn65VIxOA+YvNNl9HV3qv70T7CNwjODHZrLwvd1Q==", + "dev": true }, "tsutils": { "version": "3.17.1", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.17.1.tgz", - "integrity": "sha1-7XGZF/EcoN7lhicrKsSeAVot11k=", + "integrity": "sha512-kzeQ5B8H3w60nFY2g8cJIuH7JDpsALXySGtwGJ0p2LSjLgay3NdIpqq5SoOBe46bKDW2iq25irHCr8wjomUS2g==", "dev": true, "requires": { "tslib": "^1.8.1" - }, - "dependencies": { - "tslib": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", - "integrity": "sha1-yIHhPMcBWJTtkUhi0nZDb6mkcEM=", - "dev": true - } } }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", - "integrity": "sha1-B7ggO/pwVsBlcFDjzNLDdzC6uPE=", + "integrity": "sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew==", "dev": true, "requires": { "prelude-ls": "^1.2.1" @@ -5998,19 +6060,19 @@ "type-detect": { "version": "4.0.8", "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.0.8.tgz", - "integrity": "sha1-dkb7XxiHHPu3dJ5pvTmmOI63RQw=", + "integrity": "sha512-0fr/mIH1dlO+x7TlcMy+bIDqKPsw/70tVyeHW787goQjhmqaZe10uwLujubK9q9Lg6Fiho1KUKDYz0Z7k7g5/g==", "dev": true }, "type-fest": { "version": "0.8.1", "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", - "integrity": "sha1-CeJJ696FHTseSNJ8EFREZn8XuD0=", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", "dev": true }, "type-is": { "version": "1.6.18", "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", - "integrity": "sha1-TlUs0F3wlGfcvE73Od6J8s83wTE=", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", "dev": true, "requires": { "media-typer": "0.3.0", @@ -6026,7 +6088,7 @@ "typedarray-to-buffer": { "version": "3.1.5", "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha1-qX7nqf9CaRufeD/xvFES/j/KkIA=", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", "dev": true, "requires": { "is-typedarray": "^1.0.0" @@ -6092,13 +6154,13 @@ "typescript": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.0.2.tgz", - "integrity": "sha1-fqfIh3fHI8aB4zv3mIvl0AjQWsI=", + "integrity": "sha512-e4ERvRV2wb+rRZ/IQeb3jm2VxBsirQLpQhdxplZ2MEzGvDkkMmPglecnNDfSUBivMjP93vRbngYYDQqQ/78bcQ==", "dev": true }, "typescript-cached-transpile": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typescript-cached-transpile/-/typescript-cached-transpile-0.0.6.tgz", - "integrity": "sha1-HR8GIOuynPjYwR5TU8K09D36/AE=", + "integrity": "sha512-bfPc7YUW0PrVkQHU0xN0ANRuxdPgoYYXtZEW6PNkH5a97/AOM+kPPxSTMZbpWA3BG1do22JUkfC60KoCKJ9VZQ==", "dev": true, "requires": { "@types/node": "^12.12.7", @@ -6107,53 +6169,47 @@ }, "dependencies": { "@types/node": { - "version": "12.12.54", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.54.tgz", - "integrity": "sha1-pLWNjfOkZ3tsCL+8lLetenpfgtE=", + "version": "12.12.56", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.12.56.tgz", + "integrity": "sha512-8OdIupOIZtmObR13fvGyTvpcuzKmMugkATeVcfNwCjGtHxhjEKmOvLqXwR8U9VOtNnZ4EXaSfNiLVsPinaCXkQ==", "dev": true }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", - "integrity": "sha1-SdQ8RaiM2Wd2aMt74bRu/bjS4cA=", + "integrity": "sha512-yhlQgA6mnOJUKOsRUFsgJdQCvkKhcz8tlZG5HBQfReYZy46OwLcY+Zia0mtdHsOo9y/hP+CxMN0TU9QxoOtG4g==", "dev": true, "requires": { "graceful-fs": "^4.2.0", "jsonfile": "^4.0.0", "universalify": "^0.1.0" } - }, - "tslib": { - "version": "1.13.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.13.0.tgz", - "integrity": "sha1-yIHhPMcBWJTtkUhi0nZDb6mkcEM=", - "dev": true } } }, "ua-parser-js": { "version": "0.7.21", "resolved": "https://registry.npmjs.org/ua-parser-js/-/ua-parser-js-0.7.21.tgz", - "integrity": "sha1-hTz5zpP2QvZxdCc8w0Vlrm8wh3c=", + "integrity": "sha512-+O8/qh/Qj8CgC6eYBVBykMrNtp5Gebn4dlGD/kKXVkJNDwyrAwSIqwz8CDf+tsAIWVycKcku6gIXJ0qwx/ZXaQ==", "dev": true }, "uglify-js": { - "version": "3.10.2", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.2.tgz", - "integrity": "sha1-jPoSCf0EGZzIp/mTDd7bMLDxkS0=", + "version": "3.10.4", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.10.4.tgz", + "integrity": "sha512-kBFT3U4Dcj4/pJ52vfjCSfyLyvG9VYYuGYPmrPvAxRw/i7xHiT4VvCev+uiEMcEEiu6UNB6KgWmGtSUYIWScbw==", "dev": true, "optional": true }, "unicode-canonical-property-names-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", - "integrity": "sha1-JhmADEyCWADv3YNDr33Zkzy+KBg=", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", "dev": true }, "unicode-match-property-ecmascript": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", - "integrity": "sha1-jtKjJWmWG86SJ9Cc0/+7j+1fAgw=", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", "dev": true, "requires": { "unicode-canonical-property-names-ecmascript": "^1.0.4", @@ -6163,19 +6219,19 @@ "unicode-match-property-value-ecmascript": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.2.0.tgz", - "integrity": "sha1-DZH2AO7rMJaqlisdb8iIduZOpTE=", + "integrity": "sha512-wjuQHGQVofmSJv1uVISKLE5zO2rNGzM/KCYZch/QQvez7C1hUhBIuZ701fYXExuufJFMPhv2SyL8CyoIfMLbIQ==", "dev": true }, "unicode-property-aliases-ecmascript": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.1.0.tgz", - "integrity": "sha1-3Vepn2IHvt/0Yoq++5TFDblByPQ=", + "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", "dev": true }, "universalify": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz", - "integrity": "sha1-tkb2m+OULavOzJ1mOcgNwQXvqmY=", + "integrity": "sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg==", "dev": true }, "unpipe": { @@ -6185,9 +6241,9 @@ "dev": true }, "uri-js": { - "version": "4.2.2", - "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", - "integrity": "sha1-lMVA4f93KVbiKZUHwBCupsiDjrA=", + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.0.tgz", + "integrity": "sha512-B0yRTzYdUCCn9n+F4+Gh4yIDtMQcaJsmYBDsTSG8g/OejKBodLQ2IHfN3bM7jUsRXndopT7OIXWdYqc1fjmV6g==", "dev": true, "requires": { "punycode": "^2.1.0" @@ -6208,19 +6264,19 @@ "uuid": { "version": "3.4.0", "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", - "integrity": "sha1-sj5DWK+oogL+ehAK8fX4g/AgB+4=", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", "dev": true }, "v8-compile-cache": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/v8-compile-cache/-/v8-compile-cache-2.1.1.tgz", - "integrity": "sha1-VLw83UMxe8qR413K8wWxpyN950U=", + "integrity": "sha512-8OQ9CL+VWyt3JStj7HX7/ciTL2V3Rl1Wf5OL+SNTm0yK1KvtReVulksyeRnCANHHuUxHlQig+JJDlUhBt1NQDQ==", "dev": true }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", - "integrity": "sha1-/JH2uce6FchX9MssXe/uw51PQQo=", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "requires": { "spdx-correct": "^3.0.0", @@ -6230,13 +6286,13 @@ "validator": { "version": "8.2.0", "resolved": "https://registry.npmjs.org/validator/-/validator-8.2.0.tgz", - "integrity": "sha1-PBI3KQ43CSNVNE/veMIxJJ2rd7k=", + "integrity": "sha512-Yw5wW34fSv5spzTXNkokD6S6/Oq92d8q/t14TqsS3fAiA1RYnxSFSIZ+CY3n6PGGRCq5HhJTSepQvFUS2QUDxA==", "dev": true }, "vlq": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/vlq/-/vlq-0.2.3.tgz", - "integrity": "sha1-jz5DKM9jsVQMDWfhsneDhviXWyY=", + "integrity": "sha512-DRibZL6DsNhIgYQ+wNdWDL2SL3bKPlVrRiBqV5yuMm++op8W4kGFtaQfCs4KEJn0wBZcHVHJ3eoywX8983k1ow==", "dev": true }, "void-elements": { @@ -6248,7 +6304,7 @@ "which": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha1-fGqN0KY2oDJ+ELWckobu6T8/UbE=", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", "dev": true, "requires": { "isexe": "^2.0.0" @@ -6263,7 +6319,7 @@ "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", - "integrity": "sha1-YQY29rH3A4kb00dxzLF/uTtHB5w=", + "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, "wordwrap": { @@ -6275,7 +6331,7 @@ "wrap-ansi": { "version": "6.2.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", - "integrity": "sha1-6Tk7oHEC5skaOyIUePAlfNKFblM=", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", "dev": true, "requires": { "ansi-styles": "^4.0.0", @@ -6286,7 +6342,7 @@ "ansi-styles": { "version": "4.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.2.1.tgz", - "integrity": "sha1-kK51xCTQCNJiTFvynq0xd+v881k=", + "integrity": "sha512-9VGjrMsG1vePxcSweQsN20KY/c4zN0h9fLjqAbwbPfahM3t+NL+M9HC8xeXG2I8pX5NoamTGNuomEUFI7fcUjA==", "dev": true, "requires": { "@types/color-name": "^1.1.1", @@ -6296,7 +6352,7 @@ "color-convert": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha1-ctOmjVmMm9s68q0ehPIdiWq9TeM=", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", "dev": true, "requires": { "color-name": "~1.1.4" @@ -6305,25 +6361,25 @@ "color-name": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha1-wqCah6y95pVD3m9j+jmVyCbFNqI=", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", "dev": true }, "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha1-6Bj9ac5cz8tARZT4QpY79TFkzDc=", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha1-8Rb4Bk/pCz94RKOJl8C3UFEmnx0=", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha1-lSGCxGzHssMT0VluYjmSvRY7crU=", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { "emoji-regex": "^8.0.0", @@ -6342,7 +6398,7 @@ "write": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", - "integrity": "sha1-CADhRSO5I6OH5BUSPIZWFqrg9cM=", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", "dev": true, "requires": { "mkdirp": "^0.5.1" @@ -6351,7 +6407,7 @@ "write-file-atomic": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.3.tgz", - "integrity": "sha1-Vr1cWlxwSBzRnFcb05q5ZaXeVug=", + "integrity": "sha512-AvHcyZ5JnSfq3ioSyjrBkH9yW4m7Ayk8/9My/DD9onKeu/94fwrMocemO2QAJFAlnnDN+ZDS+ZjAR5ua1/PV/Q==", "dev": true, "requires": { "imurmurhash": "^0.1.4", @@ -6363,7 +6419,7 @@ "ws": { "version": "7.3.1", "resolved": "https://registry.npmjs.org/ws/-/ws-7.3.1.tgz", - "integrity": "sha1-0FR79n985PEqct/jEmLGjX3FUcg=", + "integrity": "sha512-D3RuNkynyHmEJIpD2qrgVkc9DQ23OrN/moAwZX4L8DfvszsJxpjQuUq3LMx6HoYji9fbIOBY18XWBsAux1ZZUA==", "dev": true }, "xmlhttprequest-ssl": { @@ -6375,19 +6431,19 @@ "xtend": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha1-u3J3n1+kZRhrH0OPZ0+jR/2121Q=", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", "dev": true }, "y18n": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/y18n/-/y18n-4.0.0.tgz", - "integrity": "sha1-le+U+F7MgdAHwmThkKEg8KPIVms=", + "integrity": "sha512-r9S/ZyXu/Xu9q1tYlpsLIsa3EeLXXk0VwlxqTcFRfg9EhMW+17kbt9G0NrgCmhGb5vT2hyhJZLfDGx+7+5Uj/w==", "dev": true }, "yargs": { "version": "15.4.1", "resolved": "https://registry.npmjs.org/yargs/-/yargs-15.4.1.tgz", - "integrity": "sha1-DYehbeAa7p2L7Cv7909nhRcw9Pg=", + "integrity": "sha512-aePbxDmcYW++PaqBsJ+HYUFwCdv4LVvdnhBy78E57PIor8/OVvhMrADFFEDh8DHDFRv/O9i3lPhsENjO7QX0+A==", "dev": true, "requires": { "cliui": "^6.0.0", @@ -6406,19 +6462,19 @@ "emoji-regex": { "version": "8.0.0", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha1-6Bj9ac5cz8tARZT4QpY79TFkzDc=", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", "dev": true }, "is-fullwidth-code-point": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha1-8Rb4Bk/pCz94RKOJl8C3UFEmnx0=", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", "dev": true }, "string-width": { "version": "4.2.0", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", - "integrity": "sha1-lSGCxGzHssMT0VluYjmSvRY7crU=", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", "dev": true, "requires": { "emoji-regex": "^8.0.0", @@ -6431,7 +6487,7 @@ "yargs-parser": { "version": "18.1.3", "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-18.1.3.tgz", - "integrity": "sha1-vmjEl1xrKr9GkjawyHA2L6sJp7A=", + "integrity": "sha512-o50j0JeToy/4K6OZcaQmW6lyXXKhq7csREXcDwk2omFPJEwUNOVtJKvmDr9EI1fAJZUyZcRF7kxGBWmRXudrCQ==", "dev": true, "requires": { "camelcase": "^5.0.0", @@ -6447,13 +6503,13 @@ "yn": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/yn/-/yn-3.1.1.tgz", - "integrity": "sha1-HodAGgnXZ8HV6rJqbkwYUYLS61A=", + "integrity": "sha512-Ux4ygGWsu2c7isFWe8Yu1YluJmqVhxqK2cLXNQA5AcC3QfbGNpM7fu0Y8b/z16pXLnFxZYvWhd3fhBY9DLmC6Q==", "dev": true }, "z-schema": { "version": "3.18.4", "resolved": "https://registry.npmjs.org/z-schema/-/z-schema-3.18.4.tgz", - "integrity": "sha1-6oEysnlTPuYL4khaAvfj5CVBqaI=", + "integrity": "sha512-DUOKC/IhbkdLKKiV89gw9DUauTV8U/8yJl1sjf6MtDmzevLKOF2duNJ495S3MFVjqZarr+qNGCPbkg4mu4PpLw==", "dev": true, "requires": { "commander": "^2.7.1", diff --git a/package.json b/package.json index 7236dc47..e49ac91e 100644 --- a/package.json +++ b/package.json @@ -38,6 +38,7 @@ "eslint": "^7.7.0", "eslint-config-prettier": "^6.11.0", "eslint-plugin-prettier": "^3.1.4", + "eslint-plugin-tsdoc": "^0.2.6", "karma": "^5.1.1", "karma-chai": "^0.1.0", "karma-chrome-launcher": "^3.1.0", @@ -78,7 +79,7 @@ "build:dts": "npm run build:ts && api-extractor run --typescript-compiler-folder node_modules/typescript --local && rimraf 'lib/**/*.d.ts*'", "build:bundle": "rollup -c rollup.config.js", "build": "npm run build:dts && npm run build:bundle", - "lint": "eslint -v && eslint --ext '.js,.ts' src test && tsc --noEmit", + "lint": "eslint -v && eslint --ext '.js,.ts' --max-warnings=0 src test && tsc -v && tsc --noEmit", "format": "eslint --ext '.js,.ts' src test --fix", "coverage": "nyc mocha test/node", "prepare": "node etc/prepare.js", diff --git a/src/binary.ts b/src/binary.ts index aaab9bfc..a9031f05 100644 --- a/src/binary.ts +++ b/src/binary.ts @@ -1,74 +1,51 @@ import { Buffer } from 'buffer'; +import type { EJSONOptions } from './extended_json'; +import { haveBuffer, isBuffer, isUint8Array } from './parser/utils'; -/** - * A class representation of the BSON Binary type. - */ +type BinarySequence = Uint8Array | Buffer | number[]; + +export type BinaryEJSON = + | { + $type: string; + $binary: string; + } + | { + $binary: { + subType: string; + base64: string; + }; + }; + +/** A class representation of the BSON Binary type. */ export class Binary { - static readonly BUFFER_SIZE = 256; + _bsontype!: 'Binary'; - /** - * Default BSON type - * - * @classconstant SUBTYPE_DEFAULT - **/ + /** Initial buffer default size */ + static readonly BUFFER_SIZE = 256; + /** Default BSON type */ static readonly SUBTYPE_DEFAULT = 0; - /** - * Function BSON type - * - * @classconstant SUBTYPE_DEFAULT - **/ + /** Function BSON type */ static readonly SUBTYPE_FUNCTION = 1; - /** - * Byte Array BSON type - * - * @classconstant SUBTYPE_DEFAULT - **/ + /** Byte Array BSON type */ static readonly SUBTYPE_BYTE_ARRAY = 2; - /** - * OLD UUID BSON type - * - * @classconstant SUBTYPE_DEFAULT - **/ + /** Deprecated UUID BSON type @deprecated Please use SUBTYPE_UUID */ static readonly SUBTYPE_UUID_OLD = 3; - /** - * UUID BSON type - * - * @classconstant SUBTYPE_DEFAULT - **/ + /** UUID BSON type */ static readonly SUBTYPE_UUID = 4; - /** - * MD5 BSON type - * - * @classconstant SUBTYPE_DEFAULT - **/ + /** MD5 BSON type */ static readonly SUBTYPE_MD5 = 5; - /** - * User BSON type - * - * @classconstant SUBTYPE_DEFAULT - **/ + /** User BSON type */ static readonly SUBTYPE_USER_DEFINED = 128; - buffer: any; + buffer: BinarySequence; sub_type: number; position: number; /** - * Create a Binary type - * - * Sub types - * - **BSON.BSON_BINARY_SUBTYPE_DEFAULT**, default BSON type. - * - **BSON.BSON_BINARY_SUBTYPE_FUNCTION**, BSON function type. - * - **BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY**, BSON byte array type. - * - **BSON.BSON_BINARY_SUBTYPE_UUID**, BSON uuid type. - * - **BSON.BSON_BINARY_SUBTYPE_MD5**, BSON md5 type. - * - **BSON.BSON_BINARY_SUBTYPE_USER_DEFINED**, BSON user defined type. - * - * @param {Buffer} buffer a buffer object containing the binary data. - * @param {Number} [subType] the option binary type. - * @return {Binary} + * @param buffer - a buffer object containing the binary data. + * @param subType - the option binary type. */ - constructor(buffer, subType) { + constructor(buffer: string | BinarySequence, subType?: number) { if ( buffer != null && !(typeof buffer === 'string') && @@ -86,7 +63,7 @@ export class Binary { // Only accept Buffer, Uint8Array or Arrays if (typeof buffer === 'string') { // Different ways of writing the length of the string for the different types - if (typeof Buffer !== 'undefined') { + if (haveBuffer()) { this.buffer = Buffer.from(buffer); } else if (typeof Uint8Array !== 'undefined' || Array.isArray(buffer)) { this.buffer = writeStringToArray(buffer); @@ -98,7 +75,7 @@ export class Binary { } this.position = buffer.length; } else { - if (typeof Buffer !== 'undefined') { + if (haveBuffer()) { this.buffer = Buffer.alloc(Binary.BUFFER_SIZE); } else if (typeof Uint8Array !== 'undefined') { this.buffer = new Uint8Array(new ArrayBuffer(Binary.BUFFER_SIZE)); @@ -111,38 +88,41 @@ export class Binary { /** * Updates this binary with byte_value. * - * @method - * @param {string} byte_value a single byte we wish to write. + * @param byteValue - a single byte we wish to write. */ - put(byte_value) { + put(byteValue: string | number | Uint8Array | Buffer | number[]): void { // If it's a string and a has more than one character throw an error - if (byte_value['length'] != null && typeof byte_value !== 'number' && byte_value.length !== 1) - throw new TypeError('only accepts single character String, Uint8Array or Array'); - if ((typeof byte_value !== 'number' && byte_value < 0) || byte_value > 255) - throw new TypeError('only accepts number in a valid unsigned byte range 0-255'); + if (typeof byteValue === 'string' && byteValue.length !== 1) { + throw new TypeError('only accepts single character String'); + } else if (typeof byteValue !== 'number' && byteValue.length !== 1) + throw new TypeError('only accepts single character Uint8Array or Array'); // Decode the byte value once - let decoded_byte = null; - if (typeof byte_value === 'string') { - decoded_byte = byte_value.charCodeAt(0); - } else if (byte_value['length'] != null) { - decoded_byte = byte_value[0]; + let decodedByte: number; + if (typeof byteValue === 'string') { + decodedByte = byteValue.charCodeAt(0); + } else if (typeof byteValue === 'number') { + decodedByte = byteValue; } else { - decoded_byte = byte_value; + decodedByte = byteValue[0]; + } + + if (decodedByte < 0 || decodedByte > 255) { + throw new TypeError('only accepts number in a valid unsigned byte range 0-255'); } if (this.buffer.length > this.position) { - this.buffer[this.position++] = decoded_byte; + this.buffer[this.position++] = decodedByte; } else { - if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) { + if (isBuffer(this.buffer)) { // Create additional overflow buffer const buffer = Buffer.alloc(Binary.BUFFER_SIZE + this.buffer.length); // Combine the two buffers together this.buffer.copy(buffer, 0, 0, this.buffer.length); this.buffer = buffer; - this.buffer[this.position++] = decoded_byte; + this.buffer[this.position++] = decodedByte; } else { - let buffer = null; + let buffer: Uint8Array | number[]; // Create a new buffer (typed or normal array) if (isUint8Array(this.buffer)) { buffer = new Uint8Array(new ArrayBuffer(Binary.BUFFER_SIZE + this.buffer.length)); @@ -158,7 +138,7 @@ export class Binary { // Reassign the buffer this.buffer = buffer; // Write the byte - this.buffer[this.position++] = decoded_byte; + this.buffer[this.position++] = decodedByte; } } } @@ -166,24 +146,22 @@ export class Binary { /** * Writes a buffer or string to the binary. * - * @method - * @param {(Buffer|string)} string a string or buffer to be written to the Binary BSON object. - * @param {number} offset specify the binary of where to write the content. - * @return {null} + * @param sequence - a string or buffer to be written to the Binary BSON object. + * @param offset - specify the binary of where to write the content. */ - write(string, offset) { + write(sequence: string | BinarySequence, offset: number): void { offset = typeof offset === 'number' ? offset : this.position; // If the buffer is to small let's extend the buffer - if (this.buffer.length < offset + string.length) { - let buffer = null; + if (this.buffer.length < offset + sequence.length) { + let buffer: Buffer | Uint8Array | null = null; // If we are in node.js - if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) { - buffer = Buffer.alloc(this.buffer.length + string.length); + if (isBuffer(this.buffer)) { + buffer = Buffer.alloc(this.buffer.length + sequence.length); this.buffer.copy(buffer, 0, 0, this.buffer.length); } else if (isUint8Array(this.buffer)) { // Create a new buffer - buffer = new Uint8Array(new ArrayBuffer(this.buffer.length + string.length)); + buffer = new Uint8Array(new ArrayBuffer(this.buffer.length + sequence.length)); // Copy the content for (let i = 0; i < this.position; i++) { buffer[i] = this.buffer[i]; @@ -191,32 +169,32 @@ export class Binary { } // Assign the new buffer - this.buffer = buffer; + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + this.buffer = buffer!; } - if (typeof Buffer !== 'undefined' && Buffer.isBuffer(string) && Buffer.isBuffer(this.buffer)) { - string.copy(this.buffer, offset, 0, string.length); + if (isBuffer(sequence) && isBuffer(this.buffer)) { + sequence.copy(this.buffer, offset, 0, sequence.length); this.position = - offset + string.length > this.position ? offset + string.length : this.position; + offset + sequence.length > this.position ? offset + sequence.length : this.position; // offset = string.length - } else if ( - typeof Buffer !== 'undefined' && - typeof string === 'string' && - Buffer.isBuffer(this.buffer) - ) { - this.buffer.write(string, offset, string.length, 'binary'); + } else if (typeof sequence === 'string' && isBuffer(this.buffer)) { + this.buffer.write(sequence, offset, sequence.length, 'binary'); this.position = - offset + string.length > this.position ? offset + string.length : this.position; + offset + sequence.length > this.position ? offset + sequence.length : this.position; // offset = string.length; - } else if (isUint8Array(string) || (Array.isArray(string) && typeof string !== 'string')) { - for (let i = 0; i < string.length; i++) { - this.buffer[offset++] = string[i]; + } else if ( + isUint8Array(sequence) || + (Array.isArray(sequence) && typeof sequence !== 'string') + ) { + for (let i = 0; i < sequence.length; i++) { + this.buffer[offset++] = sequence[i]; } this.position = offset > this.position ? offset : this.position; - } else if (typeof string === 'string') { - for (let i = 0; i < string.length; i++) { - this.buffer[offset++] = string.charCodeAt(i); + } else if (typeof sequence === 'string') { + for (let i = 0; i < sequence.length; i++) { + this.buffer[offset++] = sequence.charCodeAt(i); } this.position = offset > this.position ? offset : this.position; @@ -226,12 +204,10 @@ export class Binary { /** * Reads **length** bytes starting at **position**. * - * @method - * @param {number} position read from the given position in the Binary. - * @param {number} length the number of bytes to read. - * @return {Buffer} + * @param position - read from the given position in the Binary. + * @param length - the number of bytes to read. */ - read(position, length) { + read(position: number, length: number): BinarySequence { length = length && length > 0 ? length : this.position; // Let's return the data based on the type we have @@ -254,24 +230,18 @@ export class Binary { /** * Returns the value of this binary as a string. - * - * @method - * @return {string} + * @param asRaw - Will skip converting to a string + * @remarks + * This is handy when calling this function conditionally for some key value pairs and not others */ - value(asRaw) { - asRaw = asRaw == null ? false : asRaw; + value(asRaw?: boolean): string | BinarySequence { + asRaw = !!asRaw; // Optimize to serialize for the situation where the data == size of buffer - if ( - asRaw && - typeof Buffer !== 'undefined' && - Buffer.isBuffer(this.buffer) && - this.buffer.length === this.position - ) - return this.buffer; + if (asRaw && isBuffer(this.buffer) && this.buffer.length === this.position) return this.buffer; // If it's a node.js buffer object - if (typeof Buffer !== 'undefined' && Buffer.isBuffer(this.buffer)) { + if (isBuffer(this.buffer)) { return asRaw ? this.buffer.slice(0, this.position) : this.buffer.toString('binary', 0, this.position); @@ -300,38 +270,31 @@ export class Binary { } } - /** - * Length. - * - * @method - * @return {number} the length of the binary. - */ - length() { + /** the length of the binary sequence */ + length(): number { return this.position; } - /** - * @ignore - */ - toJSON() { - return this.buffer != null ? this.buffer.toString('base64') : ''; + /** @internal */ + toJSON(): string { + if (!this.buffer) return ''; + const buffer = Buffer.from(this.buffer as Uint8Array); + return buffer.toString('base64'); } - /** - * @ignore - */ - toString(format) { - return this.buffer != null ? this.buffer.slice(0, this.position).toString(format) : ''; + /** @internal */ + toString(format: BufferEncoding): string { + if (!this.buffer) return ''; + const buffer = Buffer.from(this.buffer.slice(0, this.position) as Uint8Array); + return buffer.toString(format); } - /** - * @ignore - */ - toExtendedJSON(options) { + /** @internal */ + toExtendedJSON(options?: EJSONOptions): BinaryEJSON { options = options || {}; const base64String = Buffer.isBuffer(this.buffer) ? this.buffer.toString('base64') - : Buffer.from(this.buffer).toString('base64'); + : Buffer.from(this.buffer as Uint8Array).toString('base64'); const subType = Number(this.sub_type).toString(16); if (options.legacy) { @@ -348,18 +311,25 @@ export class Binary { }; } - /** - * @ignore - */ - static fromExtendedJSON(doc, options) { + /** @internal */ + static fromExtendedJSON( + doc: { $type: string; $binary: string | { subType: string; base64: string } }, + options?: EJSONOptions + ): Binary { options = options || {}; - let data, type; - if (options.legacy) { + let data: Buffer | undefined; + let type; + if (options.legacy && typeof doc.$binary === 'string') { type = doc.$type ? parseInt(doc.$type, 16) : 0; data = Buffer.from(doc.$binary, 'base64'); } else { - type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; - data = Buffer.from(doc.$binary.base64, 'base64'); + if (typeof doc.$binary !== 'string') { + type = doc.$binary.subType ? parseInt(doc.$binary.subType, 16) : 0; + data = Buffer.from(doc.$binary.base64, 'base64'); + } + } + if (!data) { + throw new TypeError(`Unexpected Binary Extended JSON format ${JSON.stringify(doc)}`); } return new Binary(data, type); } @@ -367,18 +337,12 @@ export class Binary { /** * Binary default subtype - * @ignore + * @internal */ const BSON_BINARY_SUBTYPE_DEFAULT = 0; -function isUint8Array(obj) { - return Object.prototype.toString.call(obj) === '[object Uint8Array]'; -} - -/** - * @ignore - */ -function writeStringToArray(data) { +/** @internal */ +function writeStringToArray(data: string) { // Create a buffer const buffer = typeof Uint8Array !== 'undefined' @@ -396,9 +360,13 @@ function writeStringToArray(data) { /** * Convert Array ot Uint8Array to Binary String * - * @ignore + * @internal */ -function convertArraytoUtf8BinaryString(byteArray, startIndex, endIndex) { +function convertArraytoUtf8BinaryString( + byteArray: number[] | Uint8Array, + startIndex: number, + endIndex: number +) { let result = ''; for (let i = startIndex; i < endIndex; i++) { result = result + String.fromCharCode(byteArray[i]); diff --git a/src/bson.ts b/src/bson.ts index 19701554..10bdcb1a 100644 --- a/src/bson.ts +++ b/src/bson.ts @@ -19,8 +19,8 @@ import { MinKey } from './min_key'; import { ObjectId } from './objectid'; import { calculateObjectSize as internalCalculateObjectSize } from './parser/calculate_size'; // Parts of the parser -import { deserialize as internalDeserialize } from './parser/deserializer'; -import { serializeInto as internalSerialize } from './parser/serializer'; +import { DeserializationOptions, deserialize as internalDeserialize } from './parser/deserializer'; +import { SerializationOptions, serializeInto as internalSerialize } from './parser/serializer'; import { BSONRegExp } from './regexp'; import { BSONSymbol } from './symbol'; import { Timestamp } from './timestamp'; @@ -31,6 +31,7 @@ export { BSON_BINARY_SUBTYPE_MD5, BSON_BINARY_SUBTYPE_USER_DEFINED, BSON_BINARY_SUBTYPE_UUID, + BSON_BINARY_SUBTYPE_UUID_NEW, BSON_DATA_ARRAY, BSON_DATA_BINARY, BSON_DATA_BOOLEAN, @@ -74,7 +75,9 @@ export { MaxKey, BSONRegExp, Decimal128, - // legacy support + // In 4.0.0 and 4.0.1, this property name was changed to ObjectId to match the class name. + // This caused interoperability problems with previous versions of the library, so in + // later builds we changed it back to ObjectID (capital D) to match legacy implementations. ObjectId as ObjectID }; @@ -86,12 +89,11 @@ export const EJSON = { }; export interface Document { + // eslint-disable-next-line @typescript-eslint/no-explicit-any [key: string]: any; } -/** - * @ignore - */ +/** @internal */ // Default Max Size const MAXSIZE = 1024 * 1024 * 17; @@ -101,10 +103,9 @@ let buffer = Buffer.alloc(MAXSIZE); /** * Sets the size of the internal serialization buffer. * - * @method - * @param {number} size The desired size for the internal serialization buffer + * @param size - The desired size for the internal serialization buffer */ -export function setInternalBufferSize(size) { +export function setInternalBufferSize(size: number): void { // Resize the internal serialization buffer if needed if (buffer.length < size) { buffer = Buffer.alloc(size); @@ -114,14 +115,10 @@ export function setInternalBufferSize(size) { /** * Serialize a Javascript object. * - * @param {Object} object the Javascript object to serialize. - * @param {Boolean} [options.checkKeys] the serializer will check if keys are valid. - * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**. - * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**. - * @return {Buffer} returns the Buffer object containing the serialized object. + * @param object - the Javascript object to serialize. + * @returns Buffer object containing the serialized object. */ -export function serialize(object, options) { - options = options || {}; +export function serialize(object: Document, options: SerializationOptions = {}): Buffer { // Unpack the options const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; const serializeFunctions = @@ -159,18 +156,18 @@ export function serialize(object, options) { } /** - * Serialize a Javascript object using a predefined Buffer and index into the buffer, useful when pre-allocating the space for serialization. + * Serialize a Javascript object using a predefined Buffer and index into the buffer, + * useful when pre-allocating the space for serialization. * - * @param {Object} object the Javascript object to serialize. - * @param {Buffer} buffer the Buffer you pre-allocated to store the serialized BSON object. - * @param {Boolean} [options.checkKeys] the serializer will check if keys are valid. - * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**. - * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**. - * @param {Number} [options.index] the index in the buffer where we wish to start serializing into. - * @return {Number} returns the index pointing to the last written byte in the buffer. + * @param object - the Javascript object to serialize. + * @param finalBuffer - the Buffer you pre-allocated to store the serialized BSON object. + * @returns the index pointing to the last written byte in the buffer. */ -export function serializeWithBufferAndIndex(object, finalBuffer, options) { - options = options || {}; +export function serializeWithBufferAndIndex( + object: Document, + finalBuffer: Buffer, + options: SerializationOptions = {} +): number { // Unpack the options const checkKeys = typeof options.checkKeys === 'boolean' ? options.checkKeys : false; const serializeFunctions = @@ -198,32 +195,29 @@ export function serializeWithBufferAndIndex(object, finalBuffer, options) { /** * Deserialize data as BSON. * - * @param {Buffer} buffer the buffer containing the serialized set of BSON documents. - * @param {Object} [options.evalFunctions=false] evaluate functions in the BSON document scoped to the object deserialized. - * @param {Object} [options.cacheFunctions=false] cache evaluated functions for reuse. - * @param {Object} [options.cacheFunctionsCrc32=false] use a crc32 code for caching, otherwise use the string of the function. - * @param {Object} [options.promoteLongs=true] when deserializing a Long will fit it into a Number if it's smaller than 53 bits - * @param {Object} [options.promoteBuffers=false] when deserializing a Binary will return it as a node.js Buffer instance. - * @param {Object} [options.promoteValues=false] when deserializing will promote BSON values to their Node.js closest equivalent types. - * @param {Object} [options.fieldsAsRaw=null] allow to specify if there what fields we wish to return as unserialized raw buffer. - * @param {Object} [options.bsonRegExp=false] return BSON regular expressions as BSONRegExp instances. - * @param {boolean} [options.allowObjectSmallerThanBufferSize=false] allows the buffer to be larger than the parsed BSON object - * @return {Object} returns the deserialized Javascript Object. + * @param buffer - the buffer containing the serialized set of BSON documents. + * @returns returns the deserialized Javascript Object. */ -export function deserialize(buffer, options) { +export function deserialize(buffer: Buffer, options: DeserializationOptions = {}): Document { buffer = ensureBuffer(buffer); return internalDeserialize(buffer, options); } +export type CalculateObjectSizeOptions = Pick< + SerializationOptions, + 'serializeFunctions' | 'ignoreUndefined' +>; + /** * Calculate the bson size for a passed in Javascript object. * - * @param {Object} object the Javascript object to calculate the BSON byte size for. - * @param {Boolean} [options.serializeFunctions=false] serialize the javascript functions **(default:false)**. - * @param {Boolean} [options.ignoreUndefined=true] ignore undefined fields **(default:true)**. - * @return {Number} returns the number of bytes the BSON object will take up. + * @param object - the Javascript object to calculate the BSON byte size for + * @returns size of BSON object in bytes */ -export function calculateObjectSize(object, options) { +export function calculateObjectSize( + object: Document, + options: CalculateObjectSizeOptions = {} +): number { options = options || {}; const serializeFunctions = @@ -237,31 +231,26 @@ export function calculateObjectSize(object, options) { /** * Deserialize stream data as BSON documents. * - * @param {Buffer} data the buffer containing the serialized set of BSON documents. - * @param {Number} startIndex the start index in the data Buffer where the deserialization is to start. - * @param {Number} numberOfDocuments number of documents to deserialize. - * @param {Array} documents an array where to store the deserialized documents. - * @param {Number} docStartIndex the index in the documents array from where to start inserting documents. - * @param {Object} [options] additional options used for the deserialization. - * @param {Object} [options.evalFunctions=false] evaluate functions in the BSON document scoped to the object deserialized. - * @param {Object} [options.cacheFunctions=false] cache evaluated functions for reuse. - * @param {Object} [options.cacheFunctionsCrc32=false] use a crc32 code for caching, otherwise use the string of the function. - * @param {Object} [options.promoteLongs=true] when deserializing a Long will fit it into a Number if it's smaller than 53 bits - * @param {Object} [options.promoteBuffers=false] when deserializing a Binary will return it as a node.js Buffer instance. - * @param {Object} [options.promoteValues=false] when deserializing will promote BSON values to their Node.js closest equivalent types. - * @param {Object} [options.fieldsAsRaw=null] allow to specify if there what fields we wish to return as unserialized raw buffer. - * @param {Object} [options.bsonRegExp=false] return BSON regular expressions as BSONRegExp instances. - * @return {Number} returns the next index in the buffer after deserialization **x** numbers of documents. + * @param data - the buffer containing the serialized set of BSON documents. + * @param startIndex - the start index in the data Buffer where the deserialization is to start. + * @param numberOfDocuments - number of documents to deserialize. + * @param documents - an array where to store the deserialized documents. + * @param docStartIndex - the index in the documents array from where to start inserting documents. + * @param options - additional options used for the deserialization. + * @returns next index in the buffer after deserialization **x** numbers of documents. */ export function deserializeStream( - data, - startIndex, - numberOfDocuments, - documents, - docStartIndex, - options -) { - options = Object.assign({ allowObjectSmallerThanBufferSize: true }, options); + data: Buffer, + startIndex: number, + numberOfDocuments: number, + documents: Document[], + docStartIndex: number, + options: DeserializationOptions +): number { + const internalOptions = Object.assign( + { allowObjectSmallerThanBufferSize: true, index: 0 }, + options + ); data = ensureBuffer(data); let index = startIndex; @@ -271,9 +260,9 @@ export function deserializeStream( const size = data[index] | (data[index + 1] << 8) | (data[index + 2] << 16) | (data[index + 3] << 24); // Update options with index - options.index = index; + internalOptions.index = index; // Parse the document at this point - documents[docStartIndex + i] = internalDeserialize(data, options); + documents[docStartIndex + i] = internalDeserialize(data, internalOptions); // Adjust index by the document size index = index + size; } diff --git a/src/code.ts b/src/code.ts index 283ee1da..18cbbfaa 100644 --- a/src/code.ts +++ b/src/code.ts @@ -1,34 +1,27 @@ import type { Document } from './bson'; -/** - * A class representation of the BSON Code type. - */ +/** A class representation of the BSON Code type. */ export class Code { + _bsontype!: 'Code'; + code: string | Function; - scope: Document; + scope?: Document; /** - * Create a Code type - * - * @param {(string|function)} code a string or function. - * @param {Object} [scope] an optional scope for the function. - * @return {Code} + * @param code - a string or function. + * @param scope - an optional scope for the function. */ constructor(code: string | Function, scope?: Document) { this.code = code; this.scope = scope; } - /** - * @ignore - */ - toJSON() { - return { scope: this.scope, code: this.code }; + /** @internal */ + toJSON(): { code: string | Function; scope?: Document } { + return { code: this.code, scope: this.scope }; } - /** - * @ignore - */ - toExtendedJSON() { + /** @internal */ + toExtendedJSON(): { $code: string | Function; $scope?: Document } { if (this.scope) { return { $code: this.code, $scope: this.scope }; } @@ -36,10 +29,8 @@ export class Code { return { $code: this.code }; } - /** - * @ignore - */ - static fromExtendedJSON(doc) { + /** @internal */ + static fromExtendedJSON(doc: { $code: string | Function; $scope?: Document }): Code { return new Code(doc.$code, doc.$scope); } } diff --git a/src/constants.ts b/src/constants.ts index 18f342da..2484a7ee 100644 --- a/src/constants.ts +++ b/src/constants.ts @@ -6,194 +6,91 @@ export const BSON_INT64_MAX = Math.pow(2, 63) - 1; export const BSON_INT64_MIN = -Math.pow(2, 63); // JS MAX PRECISE VALUES -export const JS_INT_MAX = 0x20000000000000; // Any integer up to 2^53 can be precisely represented by a double. -export const JS_INT_MIN = -0x20000000000000; // Any integer down to -2^53 can be precisely represented by a double. - -/** - * Number BSON Type - * - * @classconstant BSON_DATA_NUMBER - **/ +// Any integer up to 2^53 can be precisely represented by a double. +export const JS_INT_MAX = Number.MAX_SAFE_INTEGER + 1; +// Any integer down to -2^53 can be precisely represented by a double. +export const JS_INT_MIN = Number.MIN_SAFE_INTEGER - 1; + +/** Number BSON Type */ export const BSON_DATA_NUMBER = 1; -/** - * String BSON Type - * - * @classconstant BSON_DATA_STRING - **/ +/** String BSON Type */ export const BSON_DATA_STRING = 2; -/** - * Object BSON Type - * - * @classconstant BSON_DATA_OBJECT - **/ +/** Object BSON Type */ export const BSON_DATA_OBJECT = 3; -/** - * Array BSON Type - * - * @classconstant BSON_DATA_ARRAY - **/ +/** Array BSON Type */ export const BSON_DATA_ARRAY = 4; -/** - * Binary BSON Type - * - * @classconstant BSON_DATA_BINARY - **/ +/** Binary BSON Type */ export const BSON_DATA_BINARY = 5; -/** - * Binary BSON Type - * - * @classconstant BSON_DATA_UNDEFINED - **/ +/** Binary BSON Type */ export const BSON_DATA_UNDEFINED = 6; -/** - * ObjectId BSON Type - * - * @classconstant BSON_DATA_OID - **/ +/** ObjectId BSON Type */ export const BSON_DATA_OID = 7; -/** - * Boolean BSON Type - * - * @classconstant BSON_DATA_BOOLEAN - **/ +/** Boolean BSON Type */ export const BSON_DATA_BOOLEAN = 8; -/** - * Date BSON Type - * - * @classconstant BSON_DATA_DATE - **/ +/** Date BSON Type */ export const BSON_DATA_DATE = 9; -/** - * null BSON Type - * - * @classconstant BSON_DATA_NULL - **/ +/** null BSON Type */ export const BSON_DATA_NULL = 10; -/** - * RegExp BSON Type - * - * @classconstant BSON_DATA_REGEXP - **/ +/** RegExp BSON Type */ export const BSON_DATA_REGEXP = 11; -/** - * Code BSON Type - * - * @classconstant BSON_DATA_DBPOINTER - **/ +/** Code BSON Type */ export const BSON_DATA_DBPOINTER = 12; -/** - * Code BSON Type - * - * @classconstant BSON_DATA_CODE - **/ +/** Code BSON Type */ export const BSON_DATA_CODE = 13; -/** - * Symbol BSON Type - * - * @classconstant BSON_DATA_SYMBOL - **/ +/** Symbol BSON Type */ export const BSON_DATA_SYMBOL = 14; -/** - * Code with Scope BSON Type - * - * @classconstant BSON_DATA_CODE_W_SCOPE - **/ +/** Code with Scope BSON Type */ export const BSON_DATA_CODE_W_SCOPE = 15; -/** - * 32 bit Integer BSON Type - * - * @classconstant BSON_DATA_INT - **/ +/** 32 bit Integer BSON Type */ export const BSON_DATA_INT = 16; -/** - * Timestamp BSON Type - * - * @classconstant BSON_DATA_TIMESTAMP - **/ +/** Timestamp BSON Type */ export const BSON_DATA_TIMESTAMP = 17; -/** - * Long BSON Type - * - * @classconstant BSON_DATA_LONG - **/ +/** Long BSON Type */ export const BSON_DATA_LONG = 18; -/** - * Long BSON Type - * - * @classconstant BSON_DATA_DECIMAL128 - **/ +/** Decimal128 BSON Type */ export const BSON_DATA_DECIMAL128 = 19; -/** - * MinKey BSON Type - * - * @classconstant BSON_DATA_MIN_KEY - **/ +/** MinKey BSON Type */ export const BSON_DATA_MIN_KEY = 0xff; -/** - * MaxKey BSON Type - * - * @classconstant BSON_DATA_MAX_KEY - **/ +/** MaxKey BSON Type */ export const BSON_DATA_MAX_KEY = 0x7f; -/** - * Binary Default Type - * - * @classconstant BSON_BINARY_SUBTYPE_DEFAULT - **/ +/** Binary Default Type */ export const BSON_BINARY_SUBTYPE_DEFAULT = 0; -/** - * Binary Function Type - * - * @classconstant BSON_BINARY_SUBTYPE_FUNCTION - **/ +/** Binary Function Type */ export const BSON_BINARY_SUBTYPE_FUNCTION = 1; -/** - * Binary Byte Array Type - * - * @classconstant BSON_BINARY_SUBTYPE_BYTE_ARRAY - **/ +/** Binary Byte Array Type */ export const BSON_BINARY_SUBTYPE_BYTE_ARRAY = 2; -/** - * Binary UUID Type - * - * @classconstant BSON_BINARY_SUBTYPE_UUID - **/ +/** Binary Deprecated UUID Type @deprecated Please use BSON_BINARY_SUBTYPE_UUID_NEW */ export const BSON_BINARY_SUBTYPE_UUID = 3; -/** - * Binary MD5 Type - * - * @classconstant BSON_BINARY_SUBTYPE_MD5 - **/ -export const BSON_BINARY_SUBTYPE_MD5 = 4; - -/** - * Binary User Defined Type - * - * @classconstant BSON_BINARY_SUBTYPE_USER_DEFINED - **/ +/** Binary UUID Type */ +export const BSON_BINARY_SUBTYPE_UUID_NEW = 4; + +/** Binary MD5 Type */ +export const BSON_BINARY_SUBTYPE_MD5 = 5; + +/** Binary User Defined Type */ export const BSON_BINARY_SUBTYPE_USER_DEFINED = 128; diff --git a/src/db_ref.ts b/src/db_ref.ts index 063dcdad..fa56ed38 100644 --- a/src/db_ref.ts +++ b/src/db_ref.ts @@ -1,4 +1,7 @@ +import type { Document } from './bson'; +import type { EJSONOptions } from './extended_json'; import type { ObjectId } from './objectid'; +import { isObjectLike } from './parser/utils'; export interface DBRefLike { $ref: string; @@ -6,32 +9,31 @@ export interface DBRefLike { $db?: string; } -export function isDBRefLike(o: any): o is DBRefLike { - return o['$id'] != null && o['$ref'] != null; +export function isDBRefLike(value: unknown): value is DBRefLike { + return isObjectLike(value) && value['$id'] != null && value['$ref'] != null; } -/** - * A class representation of the BSON DBRef type. - */ +/** A class representation of the BSON DBRef type. */ export class DBRef { + _bsontype!: 'DBRef'; + collection: string; oid: ObjectId; - db: string; - fields: any; + db?: string; + fields: Document; + /** - * Create a DBRef type - * - * @param {string} collection the collection name. - * @param {ObjectId} oid the reference ObjectId. - * @param {string} [db] optional db name, if omitted the reference is local to the current db. - * @return {DBRef} + * @param collection - the collection name. + * @param oid - the reference ObjectId. + * @param db - optional db name, if omitted the reference is local to the current db. */ - constructor(collection, oid, db?: string, fields?: any) { + constructor(collection: string, oid: ObjectId, db?: string, fields?: Document) { // check if namespace has been provided const parts = collection.split('.'); if (parts.length === 2) { db = parts.shift(); - collection = parts.shift(); + // eslint-disable-next-line @typescript-eslint/no-non-null-assertion + collection = parts.shift()!; } this.collection = collection; @@ -40,11 +42,20 @@ export class DBRef { this.fields = fields || {}; } - /** - * @ignore - * @api private - */ - toJSON() { + // Property provided for compatibility with the 1.x parser + // the 1.x parser used a "namespace" property, while 4.x uses "collection" + + /** @internal */ + get namespace(): string { + return this.collection; + } + /** @internal */ + set namespace(value: string) { + this.collection = value; + } + + /** @internal */ + toJSON(): DBRefLike & Document { const o = Object.assign( { $ref: this.collection, @@ -57,10 +68,8 @@ export class DBRef { return o; } - /** - * @ignore - */ - toExtendedJSON(options) { + /** @internal */ + toExtendedJSON(options?: EJSONOptions): DBRefLike { options = options || {}; let o: DBRefLike = { $ref: this.collection, @@ -76,25 +85,14 @@ export class DBRef { return o; } - /** - * @ignore - */ - static fromExtendedJSON(doc) { - const copy = Object.assign({}, doc); - ['$ref', '$id', '$db'].forEach(k => delete copy[k]); + /** @internal */ + static fromExtendedJSON(doc: DBRefLike): DBRef { + const copy = Object.assign({}, doc) as Partial; + delete copy.$ref; + delete copy.$id; + delete copy.$db; return new DBRef(doc.$ref, doc.$id, doc.$db, copy); } } Object.defineProperty(DBRef.prototype, '_bsontype', { value: 'DBRef' }); -// the 1.x parser used a "namespace" property, while 4.x uses "collection". To ensure backwards -// compatibility, let's expose "namespace" -Object.defineProperty(DBRef.prototype, 'namespace', { - get() { - return this.collection; - }, - set(val) { - this.collection = val; - }, - configurable: false -}); diff --git a/src/decimal128.ts b/src/decimal128.ts index 44189e05..e5487b76 100644 --- a/src/decimal128.ts +++ b/src/decimal128.ts @@ -69,13 +69,22 @@ const INF_POSITIVE_BUFFER = [ const EXPONENT_REGEX = /^([-+])?(\d+)?$/; +// Extract least significant 5 bits +const COMBINATION_MASK = 0x1f; +// Extract least significant 14 bits +const EXPONENT_MASK = 0x3fff; +// Value of combination field for Inf +const COMBINATION_INFINITY = 30; +// Value of combination field for NaN +const COMBINATION_NAN = 31; + // Detect if the value is a digit -function isDigit(value) { +function isDigit(value: string): boolean { return !isNaN(parseInt(value, 10)); } // Divide two uint128 values -function divideu128(value) { +function divideu128(value: { parts: [number, number, number, number] }) { const DIVISOR = Long.fromNumber(1000 * 1000 * 1000); let _rem = Long.fromNumber(0); @@ -96,7 +105,7 @@ function divideu128(value) { } // Multiply two Long values and return the 128 bit value -function multiply64x2(left, right) { +function multiply64x2(left: Long, right: Long): { high: Long; low: Long } { if (!left && !right) { return { high: Long.fromNumber(0), low: Long.fromNumber(0) }; } @@ -123,7 +132,7 @@ function multiply64x2(left, right) { return { high: productHigh, low: productLow }; } -function lessThan(left, right) { +function lessThan(left: Long, right: Long): boolean { // Make values unsigned const uhleft = left.high >>> 0; const uhright = right.high >>> 0; @@ -140,652 +149,636 @@ function lessThan(left, right) { return false; } -function invalidErr(string, message) { +function invalidErr(string: string, message: string) { throw new TypeError(`"${string}" is not a valid Decimal128 string - ${message}`); } -/** - * A class representation of the BSON Decimal128 type. - * - * @class - * @param {Buffer} bytes a buffer containing the raw Decimal128 bytes. - * @return {Double} - */ -export function Decimal128(bytes) { - this.bytes = bytes; -} +/** A class representation of the BSON Decimal128 type. */ +export class Decimal128 { + _bsontype!: 'Decimal128'; + + readonly bytes: Buffer; -/** - * Create a Decimal128 instance from a string representation - * - * @method - * @param {string} string a numeric string representation. - * @return {Decimal128} returns a Decimal128 instance. - */ -Decimal128.fromString = function (string) { - // Parse state tracking - let isNegative = false; - let sawRadix = false; - let foundNonZero = false; - - // Total number of significant digits (no leading or trailing zero) - let significantDigits = 0; - // Total number of significand digits read - let nDigitsRead = 0; - // Total number of digits (no leading zeros) - let nDigits = 0; - // The number of the digits after radix - let radixPosition = 0; - // The index of the first non-zero in *str* - let firstNonZero = 0; - - // Digits Array - const digits = [0]; - // The number of digits in digits - let nDigitsStored = 0; - // Insertion pointer for digits - let digitsInsert = 0; - // The index of the first non-zero digit - let firstDigit = 0; - // The index of the last digit - let lastDigit = 0; - - // Exponent - let exponent = 0; - // loop index over array - let i = 0; - // The high 17 digits of the significand - let significandHigh = new Long(0, 0); - // The low 17 digits of the significand - let significandLow = new Long(0, 0); - // The biased exponent - let biasedExponent = 0; - - // Read index - let index = 0; - - // Naively prevent against REDOS attacks. - // TODO: implementing a custom parsing for this, or refactoring the regex would yield - // further gains. - if (string.length >= 7000) { - throw new TypeError('' + string + ' not a valid Decimal128 string'); + /** @param bytes - a buffer containing the raw Decimal128 bytes in little endian order */ + constructor(bytes: Buffer) { + this.bytes = bytes; } - // Results - const stringMatch = string.match(PARSE_STRING_REGEXP); - const infMatch = string.match(PARSE_INF_REGEXP); - const nanMatch = string.match(PARSE_NAN_REGEXP); + /** + * Create a Decimal128 instance from a string representation + * + * @param representation - a numeric string representation. + */ + static fromString(representation: string): Decimal128 { + // Parse state tracking + let isNegative = false; + let sawRadix = false; + let foundNonZero = false; + + // Total number of significant digits (no leading or trailing zero) + let significantDigits = 0; + // Total number of significand digits read + let nDigitsRead = 0; + // Total number of digits (no leading zeros) + let nDigits = 0; + // The number of the digits after radix + let radixPosition = 0; + // The index of the first non-zero in *str* + let firstNonZero = 0; + + // Digits Array + const digits = [0]; + // The number of digits in digits + let nDigitsStored = 0; + // Insertion pointer for digits + let digitsInsert = 0; + // The index of the first non-zero digit + let firstDigit = 0; + // The index of the last digit + let lastDigit = 0; - // Validate the string - if ((!stringMatch && !infMatch && !nanMatch) || string.length === 0) { - throw new TypeError('' + string + ' not a valid Decimal128 string'); - } + // Exponent + let exponent = 0; + // loop index over array + let i = 0; + // The high 17 digits of the significand + let significandHigh = new Long(0, 0); + // The low 17 digits of the significand + let significandLow = new Long(0, 0); + // The biased exponent + let biasedExponent = 0; + + // Read index + let index = 0; + + // Naively prevent against REDOS attacks. + // TODO: implementing a custom parsing for this, or refactoring the regex would yield + // further gains. + if (representation.length >= 7000) { + throw new TypeError('' + representation + ' not a valid Decimal128 string'); + } - if (stringMatch) { - // full_match = stringMatch[0] - // sign = stringMatch[1] + // Results + const stringMatch = representation.match(PARSE_STRING_REGEXP); + const infMatch = representation.match(PARSE_INF_REGEXP); + const nanMatch = representation.match(PARSE_NAN_REGEXP); - const unsignedNumber = stringMatch[2]; - // stringMatch[3] is undefined if a whole number (ex "1", 12") - // but defined if a number w/ decimal in it (ex "1.0, 12.2") + // Validate the string + if ((!stringMatch && !infMatch && !nanMatch) || representation.length === 0) { + throw new TypeError('' + representation + ' not a valid Decimal128 string'); + } - const e = stringMatch[4]; - const expSign = stringMatch[5]; - const expNumber = stringMatch[6]; + if (stringMatch) { + // full_match = stringMatch[0] + // sign = stringMatch[1] - // they provided e, but didn't give an exponent number. for ex "1e" - if (e && expNumber === undefined) invalidErr(string, 'missing exponent power'); + const unsignedNumber = stringMatch[2]; + // stringMatch[3] is undefined if a whole number (ex "1", 12") + // but defined if a number w/ decimal in it (ex "1.0, 12.2") - // they provided e, but didn't give a number before it. for ex "e1" - if (e && unsignedNumber === undefined) invalidErr(string, 'missing exponent base'); + const e = stringMatch[4]; + const expSign = stringMatch[5]; + const expNumber = stringMatch[6]; - if (e === undefined && (expSign || expNumber)) { - invalidErr(string, 'missing e before exponent'); - } - } + // they provided e, but didn't give an exponent number. for ex "1e" + if (e && expNumber === undefined) invalidErr(representation, 'missing exponent power'); - // Get the negative or positive sign - if (string[index] === '+' || string[index] === '-') { - isNegative = string[index++] === '-'; - } + // they provided e, but didn't give a number before it. for ex "e1" + if (e && unsignedNumber === undefined) invalidErr(representation, 'missing exponent base'); - // Check if user passed Infinity or NaN - if (!isDigit(string[index]) && string[index] !== '.') { - if (string[index] === 'i' || string[index] === 'I') { - return new Decimal128(Buffer.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); - } else if (string[index] === 'N') { - return new Decimal128(Buffer.from(NAN_BUFFER)); + if (e === undefined && (expSign || expNumber)) { + invalidErr(representation, 'missing e before exponent'); + } } - } - - // Read all the digits - while (isDigit(string[index]) || string[index] === '.') { - if (string[index] === '.') { - if (sawRadix) invalidErr(string, 'contains multiple periods'); - sawRadix = true; - index = index + 1; - continue; + // Get the negative or positive sign + if (representation[index] === '+' || representation[index] === '-') { + isNegative = representation[index++] === '-'; } - if (nDigitsStored < 34) { - if (string[index] !== '0' || foundNonZero) { - if (!foundNonZero) { - firstNonZero = nDigitsRead; - } + // Check if user passed Infinity or NaN + if (!isDigit(representation[index]) && representation[index] !== '.') { + if (representation[index] === 'i' || representation[index] === 'I') { + return new Decimal128(Buffer.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER)); + } else if (representation[index] === 'N') { + return new Decimal128(Buffer.from(NAN_BUFFER)); + } + } - foundNonZero = true; + // Read all the digits + while (isDigit(representation[index]) || representation[index] === '.') { + if (representation[index] === '.') { + if (sawRadix) invalidErr(representation, 'contains multiple periods'); - // Only store 34 digits - digits[digitsInsert++] = parseInt(string[index], 10); - nDigitsStored = nDigitsStored + 1; + sawRadix = true; + index = index + 1; + continue; } - } - if (foundNonZero) nDigits = nDigits + 1; - if (sawRadix) radixPosition = radixPosition + 1; + if (nDigitsStored < 34) { + if (representation[index] !== '0' || foundNonZero) { + if (!foundNonZero) { + firstNonZero = nDigitsRead; + } - nDigitsRead = nDigitsRead + 1; - index = index + 1; - } + foundNonZero = true; - if (sawRadix && !nDigitsRead) throw new TypeError('' + string + ' not a valid Decimal128 string'); + // Only store 34 digits + digits[digitsInsert++] = parseInt(representation[index], 10); + nDigitsStored = nDigitsStored + 1; + } + } - // Read exponent if exists - if (string[index] === 'e' || string[index] === 'E') { - // Read exponent digits - const match = string.substr(++index).match(EXPONENT_REGEX); + if (foundNonZero) nDigits = nDigits + 1; + if (sawRadix) radixPosition = radixPosition + 1; - // No digits read - if (!match || !match[2]) return new Decimal128(Buffer.from(NAN_BUFFER)); + nDigitsRead = nDigitsRead + 1; + index = index + 1; + } - // Get exponent - exponent = parseInt(match[0], 10); + if (sawRadix && !nDigitsRead) + throw new TypeError('' + representation + ' not a valid Decimal128 string'); - // Adjust the index - index = index + match[0].length; - } + // Read exponent if exists + if (representation[index] === 'e' || representation[index] === 'E') { + // Read exponent digits + const match = representation.substr(++index).match(EXPONENT_REGEX); - // Return not a number - if (string[index]) return new Decimal128(Buffer.from(NAN_BUFFER)); + // No digits read + if (!match || !match[2]) return new Decimal128(Buffer.from(NAN_BUFFER)); - // Done reading input - // Find first non-zero digit in digits - firstDigit = 0; + // Get exponent + exponent = parseInt(match[0], 10); - if (!nDigitsStored) { - firstDigit = 0; - lastDigit = 0; - digits[0] = 0; - nDigits = 1; - nDigitsStored = 1; - significantDigits = 0; - } else { - lastDigit = nDigitsStored - 1; - significantDigits = nDigits; - if (significantDigits !== 1) { - while (string[firstNonZero + significantDigits - 1] === '0') { - significantDigits = significantDigits - 1; - } + // Adjust the index + index = index + match[0].length; } - } - - // Normalization of exponent - // Correct exponent based on radix position, and shift significand as needed - // to represent user input - // Overflow prevention - if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) { - exponent = EXPONENT_MIN; - } else { - exponent = exponent - radixPosition; - } + // Return not a number + if (representation[index]) return new Decimal128(Buffer.from(NAN_BUFFER)); - // Attempt to normalize the exponent - while (exponent > EXPONENT_MAX) { - // Shift exponent to significand and decrease - lastDigit = lastDigit + 1; + // Done reading input + // Find first non-zero digit in digits + firstDigit = 0; - if (lastDigit - firstDigit > MAX_DIGITS) { - // Check if we have a zero then just hard clamp, otherwise fail - const digitsString = digits.join(''); - if (digitsString.match(/^0+$/)) { - exponent = EXPONENT_MAX; - break; + if (!nDigitsStored) { + firstDigit = 0; + lastDigit = 0; + digits[0] = 0; + nDigits = 1; + nDigitsStored = 1; + significantDigits = 0; + } else { + lastDigit = nDigitsStored - 1; + significantDigits = nDigits; + if (significantDigits !== 1) { + while (representation[firstNonZero + significantDigits - 1] === '0') { + significantDigits = significantDigits - 1; + } } - - invalidErr(string, 'overflow'); } - exponent = exponent - 1; - } - while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { - // Shift last digit. can only do this if < significant digits than # stored. - if (lastDigit === 0 && significantDigits < nDigitsStored) { + // Normalization of exponent + // Correct exponent based on radix position, and shift significand as needed + // to represent user input + + // Overflow prevention + if (exponent <= radixPosition && radixPosition - exponent > 1 << 14) { exponent = EXPONENT_MIN; - significantDigits = 0; - break; + } else { + exponent = exponent - radixPosition; } - if (nDigitsStored < nDigits) { - // adjust to match digits not stored - nDigits = nDigits - 1; - } else { - // adjust to round - lastDigit = lastDigit - 1; + // Attempt to normalize the exponent + while (exponent > EXPONENT_MAX) { + // Shift exponent to significand and decrease + lastDigit = lastDigit + 1; + + if (lastDigit - firstDigit > MAX_DIGITS) { + // Check if we have a zero then just hard clamp, otherwise fail + const digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + + invalidErr(representation, 'overflow'); + } + exponent = exponent - 1; } - if (exponent < EXPONENT_MAX) { - exponent = exponent + 1; - } else { - // Check if we have a zero then just hard clamp, otherwise fail - const digitsString = digits.join(''); - if (digitsString.match(/^0+$/)) { - exponent = EXPONENT_MAX; + while (exponent < EXPONENT_MIN || nDigitsStored < nDigits) { + // Shift last digit. can only do this if < significant digits than # stored. + if (lastDigit === 0 && significantDigits < nDigitsStored) { + exponent = EXPONENT_MIN; + significantDigits = 0; break; } - invalidErr(string, 'overflow'); - } - } - // Round - // We've normalized the exponent, but might still need to round. - if (lastDigit - firstDigit + 1 < significantDigits) { - let endOfString = nDigitsRead; - - // If we have seen a radix point, 'string' is 1 longer than we have - // documented with ndigits_read, so inc the position of the first nonzero - // digit and the position that digits are read to. - if (sawRadix) { - firstNonZero = firstNonZero + 1; - endOfString = endOfString + 1; - } - // if negative, we need to increment again to account for - sign at start. - if (isNegative) { - firstNonZero = firstNonZero + 1; - endOfString = endOfString + 1; + if (nDigitsStored < nDigits) { + // adjust to match digits not stored + nDigits = nDigits - 1; + } else { + // adjust to round + lastDigit = lastDigit - 1; + } + + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + } else { + // Check if we have a zero then just hard clamp, otherwise fail + const digitsString = digits.join(''); + if (digitsString.match(/^0+$/)) { + exponent = EXPONENT_MAX; + break; + } + invalidErr(representation, 'overflow'); + } } - const roundDigit = parseInt(string[firstNonZero + lastDigit + 1], 10); - let roundBit = 0; - - if (roundDigit >= 5) { - roundBit = 1; - if (roundDigit === 5) { - roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; - for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) { - if (parseInt(string[i], 10)) { - roundBit = 1; - break; + // Round + // We've normalized the exponent, but might still need to round. + if (lastDigit - firstDigit + 1 < significantDigits) { + let endOfString = nDigitsRead; + + // If we have seen a radix point, 'string' is 1 longer than we have + // documented with ndigits_read, so inc the position of the first nonzero + // digit and the position that digits are read to. + if (sawRadix) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + // if negative, we need to increment again to account for - sign at start. + if (isNegative) { + firstNonZero = firstNonZero + 1; + endOfString = endOfString + 1; + } + + const roundDigit = parseInt(representation[firstNonZero + lastDigit + 1], 10); + let roundBit = 0; + + if (roundDigit >= 5) { + roundBit = 1; + if (roundDigit === 5) { + roundBit = digits[lastDigit] % 2 === 1 ? 1 : 0; + for (i = firstNonZero + lastDigit + 2; i < endOfString; i++) { + if (parseInt(representation[i], 10)) { + roundBit = 1; + break; + } } } } - } - if (roundBit) { - let dIdx = lastDigit; - - for (; dIdx >= 0; dIdx--) { - if (++digits[dIdx] > 9) { - digits[dIdx] = 0; - - // overflowed most significant digit - if (dIdx === 0) { - if (exponent < EXPONENT_MAX) { - exponent = exponent + 1; - digits[dIdx] = 1; - } else { - return new Decimal128( - Buffer.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER) - ); + if (roundBit) { + let dIdx = lastDigit; + + for (; dIdx >= 0; dIdx--) { + if (++digits[dIdx] > 9) { + digits[dIdx] = 0; + + // overflowed most significant digit + if (dIdx === 0) { + if (exponent < EXPONENT_MAX) { + exponent = exponent + 1; + digits[dIdx] = 1; + } else { + return new Decimal128( + Buffer.from(isNegative ? INF_NEGATIVE_BUFFER : INF_POSITIVE_BUFFER) + ); + } } } } } } - } - // Encode significand - // The high 17 digits of the significand - significandHigh = Long.fromNumber(0); - // The low 17 digits of the significand - significandLow = Long.fromNumber(0); - - // read a zero - if (significantDigits === 0) { + // Encode significand + // The high 17 digits of the significand significandHigh = Long.fromNumber(0); + // The low 17 digits of the significand significandLow = Long.fromNumber(0); - } else if (lastDigit - firstDigit < 17) { - let dIdx = firstDigit; - significandLow = Long.fromNumber(digits[dIdx++]); - significandHigh = new Long(0, 0); - - for (; dIdx <= lastDigit; dIdx++) { - significandLow = significandLow.multiply(Long.fromNumber(10)); - significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); - } - } else { - let dIdx = firstDigit; - significandHigh = Long.fromNumber(digits[dIdx++]); - for (; dIdx <= lastDigit - 17; dIdx++) { - significandHigh = significandHigh.multiply(Long.fromNumber(10)); - significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); - } - - significandLow = Long.fromNumber(digits[dIdx++]); + // read a zero + if (significantDigits === 0) { + significandHigh = Long.fromNumber(0); + significandLow = Long.fromNumber(0); + } else if (lastDigit - firstDigit < 17) { + let dIdx = firstDigit; + significandLow = Long.fromNumber(digits[dIdx++]); + significandHigh = new Long(0, 0); + + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } else { + let dIdx = firstDigit; + significandHigh = Long.fromNumber(digits[dIdx++]); - for (; dIdx <= lastDigit; dIdx++) { - significandLow = significandLow.multiply(Long.fromNumber(10)); - significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); - } - } + for (; dIdx <= lastDigit - 17; dIdx++) { + significandHigh = significandHigh.multiply(Long.fromNumber(10)); + significandHigh = significandHigh.add(Long.fromNumber(digits[dIdx])); + } - const significand = multiply64x2(significandHigh, Long.fromString('100000000000000000')); - significand.low = significand.low.add(significandLow); + significandLow = Long.fromNumber(digits[dIdx++]); - if (lessThan(significand.low, significandLow)) { - significand.high = significand.high.add(Long.fromNumber(1)); - } + for (; dIdx <= lastDigit; dIdx++) { + significandLow = significandLow.multiply(Long.fromNumber(10)); + significandLow = significandLow.add(Long.fromNumber(digits[dIdx])); + } + } - // Biased exponent - biasedExponent = exponent + EXPONENT_BIAS; - const dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; - - // Encode combination, exponent, and significand. - if (significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1))) { - // Encode '11' into bits 1 to 3 - dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61)); - dec.high = dec.high.or( - Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47)) - ); - dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff))); - } else { - dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); - dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff))); - } + const significand = multiply64x2(significandHigh, Long.fromString('100000000000000000')); + significand.low = significand.low.add(significandLow); - dec.low = significand.low; + if (lessThan(significand.low, significandLow)) { + significand.high = significand.high.add(Long.fromNumber(1)); + } - // Encode sign - if (isNegative) { - dec.high = dec.high.or(Long.fromString('9223372036854775808')); - } + // Biased exponent + biasedExponent = exponent + EXPONENT_BIAS; + const dec = { low: Long.fromNumber(0), high: Long.fromNumber(0) }; + + // Encode combination, exponent, and significand. + if ( + significand.high.shiftRightUnsigned(49).and(Long.fromNumber(1)).equals(Long.fromNumber(1)) + ) { + // Encode '11' into bits 1 to 3 + dec.high = dec.high.or(Long.fromNumber(0x3).shiftLeft(61)); + dec.high = dec.high.or( + Long.fromNumber(biasedExponent).and(Long.fromNumber(0x3fff).shiftLeft(47)) + ); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x7fffffffffff))); + } else { + dec.high = dec.high.or(Long.fromNumber(biasedExponent & 0x3fff).shiftLeft(49)); + dec.high = dec.high.or(significand.high.and(Long.fromNumber(0x1ffffffffffff))); + } - // Encode into a buffer - const buffer = Buffer.alloc(16); - index = 0; - - // Encode the low 64 bits of the decimal - // Encode low bits - buffer[index++] = dec.low.low & 0xff; - buffer[index++] = (dec.low.low >> 8) & 0xff; - buffer[index++] = (dec.low.low >> 16) & 0xff; - buffer[index++] = (dec.low.low >> 24) & 0xff; - // Encode high bits - buffer[index++] = dec.low.high & 0xff; - buffer[index++] = (dec.low.high >> 8) & 0xff; - buffer[index++] = (dec.low.high >> 16) & 0xff; - buffer[index++] = (dec.low.high >> 24) & 0xff; - - // Encode the high 64 bits of the decimal - // Encode low bits - buffer[index++] = dec.high.low & 0xff; - buffer[index++] = (dec.high.low >> 8) & 0xff; - buffer[index++] = (dec.high.low >> 16) & 0xff; - buffer[index++] = (dec.high.low >> 24) & 0xff; - // Encode high bits - buffer[index++] = dec.high.high & 0xff; - buffer[index++] = (dec.high.high >> 8) & 0xff; - buffer[index++] = (dec.high.high >> 16) & 0xff; - buffer[index++] = (dec.high.high >> 24) & 0xff; - - // Return the new Decimal128 - return new Decimal128(buffer); -}; + dec.low = significand.low; -// Extract least significant 5 bits -const COMBINATION_MASK = 0x1f; -// Extract least significant 14 bits -const EXPONENT_MASK = 0x3fff; -// Value of combination field for Inf -const COMBINATION_INFINITY = 30; -// Value of combination field for NaN -const COMBINATION_NAN = 31; + // Encode sign + if (isNegative) { + dec.high = dec.high.or(Long.fromString('9223372036854775808')); + } -/** - * Create a string representation of the raw Decimal128 value - * - * @method - * @return {string} returns a Decimal128 string representation. - */ -Decimal128.prototype.toString = function () { - // Note: bits in this routine are referred to starting at 0, - // from the sign bit, towards the coefficient. - - // decoded biased exponent (14 bits) - let biased_exponent; - // the number of significand digits - let significand_digits = 0; - // the base-10 digits in the significand - const significand = new Array(36); - for (let i = 0; i < significand.length; i++) significand[i] = 0; - // read pointer into significand - let index = 0; - - // true if the number is zero - let is_zero = false; - - // the most significant significand bits (50-46) - let significand_msb; - // temporary storage for significand decoding - let significand128 = { parts: new Array(4) }; - // indexing variables - let j, k; - - // Output string - const string = []; - - // Unpack index - index = 0; - - // Buffer reference - const buffer = this.bytes; - - // Unpack the low 64bits into a long - // bits 96 - 127 - const low = - buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); - // bits 64 - 95 - const midl = - buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); - - // Unpack the high 64bits into a long - // bits 32 - 63 - const midh = - buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); - // bits 0 - 31 - const high = - buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); - - // Unpack index - index = 0; - - // Create the state of the decimal - const dec = { - low: new Long(low, midl), - high: new Long(midh, high) - }; - - if (dec.high.lessThan(Long.ZERO)) { - string.push('-'); + // Encode into a buffer + const buffer = Buffer.alloc(16); + index = 0; + + // Encode the low 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.low.low & 0xff; + buffer[index++] = (dec.low.low >> 8) & 0xff; + buffer[index++] = (dec.low.low >> 16) & 0xff; + buffer[index++] = (dec.low.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.low.high & 0xff; + buffer[index++] = (dec.low.high >> 8) & 0xff; + buffer[index++] = (dec.low.high >> 16) & 0xff; + buffer[index++] = (dec.low.high >> 24) & 0xff; + + // Encode the high 64 bits of the decimal + // Encode low bits + buffer[index++] = dec.high.low & 0xff; + buffer[index++] = (dec.high.low >> 8) & 0xff; + buffer[index++] = (dec.high.low >> 16) & 0xff; + buffer[index++] = (dec.high.low >> 24) & 0xff; + // Encode high bits + buffer[index++] = dec.high.high & 0xff; + buffer[index++] = (dec.high.high >> 8) & 0xff; + buffer[index++] = (dec.high.high >> 16) & 0xff; + buffer[index++] = (dec.high.high >> 24) & 0xff; + + // Return the new Decimal128 + return new Decimal128(buffer); } - // Decode combination field and exponent - // bits 1 - 5 - const combination = (high >> 26) & COMBINATION_MASK; + /** Create a string representation of the raw Decimal128 value */ + toString(): string { + // Note: bits in this routine are referred to starting at 0, + // from the sign bit, towards the coefficient. + + // decoded biased exponent (14 bits) + let biased_exponent; + // the number of significand digits + let significand_digits = 0; + // the base-10 digits in the significand + const significand = new Array(36); + for (let i = 0; i < significand.length; i++) significand[i] = 0; + // read pointer into significand + let index = 0; + + // true if the number is zero + let is_zero = false; + + // the most significant significand bits (50-46) + let significand_msb; + // temporary storage for significand decoding + let significand128: { parts: [number, number, number, number] } = { parts: [0, 0, 0, 0] }; + // indexing variables + let j, k; + + // Output string + const string: string[] = []; + + // Unpack index + index = 0; + + // Buffer reference + const buffer = this.bytes; + + // Unpack the low 64bits into a long + // bits 96 - 127 + const low = + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 64 - 95 + const midl = + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + + // Unpack the high 64bits into a long + // bits 32 - 63 + const midh = + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + // bits 0 - 31 + const high = + buffer[index++] | (buffer[index++] << 8) | (buffer[index++] << 16) | (buffer[index++] << 24); + + // Unpack index + index = 0; + + // Create the state of the decimal + const dec = { + low: new Long(low, midl), + high: new Long(midh, high) + }; + + if (dec.high.lessThan(Long.ZERO)) { + string.push('-'); + } + + // Decode combination field and exponent + // bits 1 - 5 + const combination = (high >> 26) & COMBINATION_MASK; - if (combination >> 3 === 3) { - // Check for 'special' values - if (combination === COMBINATION_INFINITY) { - return string.join('') + 'Infinity'; - } else if (combination === COMBINATION_NAN) { - return 'NaN'; + if (combination >> 3 === 3) { + // Check for 'special' values + if (combination === COMBINATION_INFINITY) { + return string.join('') + 'Infinity'; + } else if (combination === COMBINATION_NAN) { + return 'NaN'; + } else { + biased_exponent = (high >> 15) & EXPONENT_MASK; + significand_msb = 0x08 + ((high >> 14) & 0x01); + } } else { - biased_exponent = (high >> 15) & EXPONENT_MASK; - significand_msb = 0x08 + ((high >> 14) & 0x01); + significand_msb = (high >> 14) & 0x07; + biased_exponent = (high >> 17) & EXPONENT_MASK; } - } else { - significand_msb = (high >> 14) & 0x07; - biased_exponent = (high >> 17) & EXPONENT_MASK; - } - // unbiased exponent - const exponent = biased_exponent - EXPONENT_BIAS; - - // Create string of significand digits - - // Convert the 114-bit binary number represented by - // (significand_high, significand_low) to at most 34 decimal - // digits through modulo and division. - significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); - significand128.parts[1] = midh; - significand128.parts[2] = midl; - significand128.parts[3] = low; - - if ( - significand128.parts[0] === 0 && - significand128.parts[1] === 0 && - significand128.parts[2] === 0 && - significand128.parts[3] === 0 - ) { - is_zero = true; - } else { - for (k = 3; k >= 0; k--) { - let least_digits = 0; - // Peform the divide - const result = divideu128(significand128); - significand128 = result.quotient; - least_digits = result.rem.low; - - // We now have the 9 least significant digits (in base 2). - // Convert and output to string. - if (!least_digits) continue; - - for (j = 8; j >= 0; j--) { - // significand[k * 9 + j] = Math.round(least_digits % 10); - significand[k * 9 + j] = least_digits % 10; - // least_digits = Math.round(least_digits / 10); - least_digits = Math.floor(least_digits / 10); + // unbiased exponent + const exponent = biased_exponent - EXPONENT_BIAS; + + // Create string of significand digits + + // Convert the 114-bit binary number represented by + // (significand_high, significand_low) to at most 34 decimal + // digits through modulo and division. + significand128.parts[0] = (high & 0x3fff) + ((significand_msb & 0xf) << 14); + significand128.parts[1] = midh; + significand128.parts[2] = midl; + significand128.parts[3] = low; + + if ( + significand128.parts[0] === 0 && + significand128.parts[1] === 0 && + significand128.parts[2] === 0 && + significand128.parts[3] === 0 + ) { + is_zero = true; + } else { + for (k = 3; k >= 0; k--) { + let least_digits = 0; + // Perform the divide + const result = divideu128(significand128); + significand128 = result.quotient; + least_digits = result.rem.low; + + // We now have the 9 least significant digits (in base 2). + // Convert and output to string. + if (!least_digits) continue; + + for (j = 8; j >= 0; j--) { + // significand[k * 9 + j] = Math.round(least_digits % 10); + significand[k * 9 + j] = least_digits % 10; + // least_digits = Math.round(least_digits / 10); + least_digits = Math.floor(least_digits / 10); + } } } - } - // Output format options: - // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd - // Regular - ddd.ddd + // Output format options: + // Scientific - [-]d.dddE(+/-)dd or [-]dE(+/-)dd + // Regular - ddd.ddd - if (is_zero) { - significand_digits = 1; - significand[index] = 0; - } else { - significand_digits = 36; - while (!significand[index]) { - significand_digits = significand_digits - 1; - index = index + 1; - } - } - - // the exponent if scientific notation is used - const scientific_exponent = significand_digits - 1 + exponent; - - // The scientific exponent checks are dictated by the string conversion - // specification and are somewhat arbitrary cutoffs. - // - // We must check exponent > 0, because if this is the case, the number - // has trailing zeros. However, we *cannot* output these trailing zeros, - // because doing so would change the precision of the value, and would - // change stored data if the string converted number is round tripped. - if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { - // Scientific format - - // if there are too many significant digits, we should just be treating numbers - // as + or - 0 and using the non-scientific exponent (this is for the "invalid - // representation should be treated as 0/-0" spec cases in decimal128-1.json) - if (significand_digits > 34) { - string.push(0); - if (exponent > 0) string.push('E+' + exponent); - else if (exponent < 0) string.push('E' + exponent); - return string.join(''); + if (is_zero) { + significand_digits = 1; + significand[index] = 0; + } else { + significand_digits = 36; + while (!significand[index]) { + significand_digits = significand_digits - 1; + index = index + 1; + } } - string.push(significand[index++]); - significand_digits = significand_digits - 1; + // the exponent if scientific notation is used + const scientific_exponent = significand_digits - 1 + exponent; + + // The scientific exponent checks are dictated by the string conversion + // specification and are somewhat arbitrary cutoffs. + // + // We must check exponent > 0, because if this is the case, the number + // has trailing zeros. However, we *cannot* output these trailing zeros, + // because doing so would change the precision of the value, and would + // change stored data if the string converted number is round tripped. + if (scientific_exponent >= 34 || scientific_exponent <= -7 || exponent > 0) { + // Scientific format + + // if there are too many significant digits, we should just be treating numbers + // as + or - 0 and using the non-scientific exponent (this is for the "invalid + // representation should be treated as 0/-0" spec cases in decimal128-1.json) + if (significand_digits > 34) { + string.push(`${0}`); + if (exponent > 0) string.push('E+' + exponent); + else if (exponent < 0) string.push('E' + exponent); + return string.join(''); + } - if (significand_digits) { - string.push('.'); - } + string.push(`${significand[index++]}`); + significand_digits = significand_digits - 1; - for (let i = 0; i < significand_digits; i++) { - string.push(significand[index++]); - } + if (significand_digits) { + string.push('.'); + } - // Exponent - string.push('E'); - if (scientific_exponent > 0) { - string.push('+' + scientific_exponent); - } else { - string.push(scientific_exponent); - } - } else { - // Regular format with no decimal place - if (exponent >= 0) { for (let i = 0; i < significand_digits; i++) { - string.push(significand[index++]); + string.push(`${significand[index++]}`); } - } else { - let radix_position = significand_digits + exponent; - // non-zero digits before radix - if (radix_position > 0) { - for (let i = 0; i < radix_position; i++) { - string.push(significand[index++]); - } + // Exponent + string.push('E'); + if (scientific_exponent > 0) { + string.push('+' + scientific_exponent); } else { - string.push('0'); + string.push(`${scientific_exponent}`); } + } else { + // Regular format with no decimal place + if (exponent >= 0) { + for (let i = 0; i < significand_digits; i++) { + string.push(`${significand[index++]}`); + } + } else { + let radix_position = significand_digits + exponent; - string.push('.'); - // add leading zeros after radix - while (radix_position++ < 0) { - string.push('0'); - } + // non-zero digits before radix + if (radix_position > 0) { + for (let i = 0; i < radix_position; i++) { + string.push(`${significand[index++]}`); + } + } else { + string.push('0'); + } + + string.push('.'); + // add leading zeros after radix + while (radix_position++ < 0) { + string.push('0'); + } - for (let i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { - string.push(significand[index++]); + for (let i = 0; i < significand_digits - Math.max(radix_position - 1, 0); i++) { + string.push(`${significand[index++]}`); + } } } + + return string.join(''); + } + + toJSON(): { $numberDecimal: string } { + return { $numberDecimal: this.toString() }; } - return string.join(''); -}; - -Decimal128.prototype.toJSON = function () { - return { $numberDecimal: this.toString() }; -}; - -/** - * @ignore - */ -Decimal128.prototype.toExtendedJSON = function () { - return { $numberDecimal: this.toString() }; -}; - -/** - * @ignore - */ -Decimal128.fromExtendedJSON = function (doc) { - return Decimal128.fromString(doc.$numberDecimal); -}; + /** @internal */ + toExtendedJSON(): { $numberDecimal: string } { + return { $numberDecimal: this.toString() }; + } + + /** @internal */ + static fromExtendedJSON(doc: { $numberDecimal: string }): Decimal128 { + return Decimal128.fromString(doc.$numberDecimal); + } +} Object.defineProperty(Decimal128.prototype, '_bsontype', { value: 'Decimal128' }); diff --git a/src/double.ts b/src/double.ts index 4e92ccaa..88c89e60 100644 --- a/src/double.ts +++ b/src/double.ts @@ -1,43 +1,41 @@ +import type { EJSONOptions } from './extended_json'; + /** * A class representation of the BSON Double type. */ export class Double { + _bsontype!: 'Double'; + value: number; /** * Create a Double type * - * @param {number|Number} value the number we want to represent as a double. - * @return {Double} + * @param value - the number we want to represent as a double. */ - constructor(value) { - if (value instanceof Number) { + constructor(value: number) { + if ((value as unknown) instanceof Number) { value = value.valueOf(); } - this.value = value; + this.value = +value; } /** * Access the number value. * - * @method - * @return {number} returns the wrapped double number. + * @returns returns the wrapped double number. */ - valueOf() { + valueOf(): number { return this.value; } - /** - * @ignore - */ - toJSON() { + /** @internal */ + toJSON(): number { return this.value; } - /** - * @ignore - */ - toExtendedJSON(options) { + /** @internal */ + toExtendedJSON(options?: EJSONOptions): number | { $numberDouble: string } { if (options && (options.legacy || (options.relaxed && isFinite(this.value)))) { return this.value; } @@ -48,7 +46,7 @@ export class Double { return { $numberDouble: `-${this.value.toFixed(1)}` }; } - let $numberDouble; + let $numberDouble: string; if (Number.isInteger(this.value)) { $numberDouble = this.value.toFixed(1); if ($numberDouble.length >= 13) { @@ -61,10 +59,8 @@ export class Double { return { $numberDouble }; } - /** - * @ignore - */ - static fromExtendedJSON(doc, options) { + /** @internal */ + static fromExtendedJSON(doc: { $numberDouble: string }, options?: EJSONOptions): number | Double { const doubleValue = parseFloat(doc.$numberDouble); return options && options.relaxed ? doubleValue : new Double(doubleValue); } diff --git a/src/ensure_buffer.ts b/src/ensure_buffer.ts index 38f2798d..8be84c79 100644 --- a/src/ensure_buffer.ts +++ b/src/ensure_buffer.ts @@ -3,12 +3,12 @@ import { Buffer } from 'buffer'; /** * Makes sure that, if a Uint8Array is passed in, it is wrapped in a Buffer. * - * @param {Buffer|Uint8Array} potentialBuffer The potential buffer - * @returns {Buffer} the input if potentialBuffer is a buffer, or a buffer that + * @param potentialBuffer - The potential buffer + * @returns Buffer the input if potentialBuffer is a buffer, or a buffer that * wraps a passed in Uint8Array - * @throws {TypeError} If anything other than a Buffer or Uint8Array is passed in + * @throws TypeError If anything other than a Buffer or Uint8Array is passed in */ -export function ensureBuffer(potentialBuffer) { +export function ensureBuffer(potentialBuffer: Buffer | Uint8Array): Buffer { if (potentialBuffer instanceof Buffer) { return potentialBuffer; } diff --git a/src/extended_json.ts b/src/extended_json.ts index 8581d80d..439ce484 100644 --- a/src/extended_json.ts +++ b/src/extended_json.ts @@ -1,4 +1,5 @@ import { Binary } from './binary'; +import type { Document } from './bson'; import { Code } from './code'; import { DBRef } from './db_ref'; import { Decimal128 } from './decimal128'; @@ -8,13 +9,43 @@ import { Long } from './long'; import { MaxKey } from './max_key'; import { MinKey } from './min_key'; import { ObjectId } from './objectid'; +import { isObjectLike } from './parser/utils'; import { BSONRegExp } from './regexp'; import { BSONSymbol } from './symbol'; import { Timestamp } from './timestamp'; -/** - * @namespace EJSON - */ +export type BSONType = + | Binary + | Code + | DBRef + | Decimal128 + | Double + | Int32 + | Long + | MaxKey + | MinKey + | ObjectId + | BSONRegExp + | BSONSymbol + | Timestamp; + +export function isBSONType(value: unknown): value is BSONType { + return ( + isObjectLike(value) && Reflect.has(value, '_bsontype') && typeof value._bsontype === 'string' + ); +} + +export interface EJSONOptions { + /** Output using the Extended JSON v1 spec */ + legacy?: boolean; + /** Enable Extended JSON's `relaxed` mode, which attempts to return native JS types where possible, rather than BSON types */ + relaxed?: boolean; + /** + * Disable Extended JSON's `relaxed` mode, which attempts to return BSON types where possible, rather than native JS types + * @deprecated Please use the relaxed property instead + */ + strict?: boolean; +} // all the types where we don't need to do any special processing and can just pass the EJSON //straight to type.fromExtendedJSON @@ -31,9 +62,10 @@ const keysToCodecs = { $regex: BSONRegExp, $regularExpression: BSONRegExp, $timestamp: Timestamp -}; +} as const; -function deserializeValue(self, key, value, options?: any) { +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function deserializeValue(value: any, options: EJSONOptions = {}) { if (typeof value === 'number') { if (options.relaxed || options.legacy) { return value; @@ -56,7 +88,9 @@ function deserializeValue(self, key, value, options?: any) { // upgrade deprecated undefined to null if (value.$undefined) return null; - const keys = Object.keys(value).filter(k => k.startsWith('$') && value[k] != null); + const keys = Object.keys(value).filter( + k => k.startsWith('$') && value[k] != null + ) as (keyof typeof keysToCodecs)[]; for (let i = 0; i < keys.length; i++) { const c = keysToCodecs[keys[i]]; if (c) return c.fromExtendedJSON(value, options); @@ -80,7 +114,7 @@ function deserializeValue(self, key, value, options?: any) { if (value.$code != null) { const copy = Object.assign({}, value); if (value.$scope) { - copy.$scope = deserializeValue(self, null, value.$scope); + copy.$scope = deserializeValue(value.$scope); } return Code.fromExtendedJSON(value); @@ -110,12 +144,6 @@ function deserializeValue(self, key, value, options?: any) { * Parse an Extended JSON string, constructing the JavaScript value or object described by that * string. * - * @memberof EJSON - * @param {string} text - * @param {object} [options] Optional settings - * @param {boolean} [options.relaxed=true] Attempt to return native JS types where possible, rather than BSON types (if true) - * @return {object} - * * @example * ```js * const { EJSON } = require('bson'); @@ -128,41 +156,37 @@ function deserializeValue(self, key, value, options?: any) { * console.log(EJSON.parse(text)); * ``` */ -export function parse(text, options) { - options = Object.assign({}, { relaxed: true, legacy: false }, options); +export function parse(text: string, options?: EJSONOptions): SerializableTypes { + const finalOptions = Object.assign({}, { relaxed: true, legacy: false }, options); // relaxed implies not strict - if (typeof options.relaxed === 'boolean') options.strict = !options.relaxed; - if (typeof options.strict === 'boolean') options.relaxed = !options.strict; + if (typeof finalOptions.relaxed === 'boolean') finalOptions.strict = !finalOptions.relaxed; + if (typeof finalOptions.strict === 'boolean') finalOptions.relaxed = !finalOptions.strict; - return JSON.parse(text, (key, value) => deserializeValue(this, key, value, options)); + return JSON.parse(text, (_key, value) => deserializeValue(value, finalOptions)); } -// -// Serializer -// - // MAX INT32 boundaries -const BSON_INT32_MAX = 0x7fffffff, - BSON_INT32_MIN = -0x80000000, - BSON_INT64_MAX = 0x7fffffffffffffff, - BSON_INT64_MIN = -0x8000000000000000; +const BSON_INT32_MAX = 0x7fffffff; +const BSON_INT32_MIN = -0x80000000; +const BSON_INT64_MAX = 0x7fffffffffffffff; +const BSON_INT64_MIN = -0x8000000000000000; + +export type JSONPrimitive = string | number | boolean | null; +export type SerializableTypes = Document | Array | JSONPrimitive; /** * Converts a BSON document to an Extended JSON string, optionally replacing values if a replacer * function is specified or optionally including only the specified properties if a replacer array * is specified. * - * @memberof EJSON - * @param {object} value The value to convert to extended JSON - * @param {function|array} [replacer] A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string - * @param {string|number} [space] A String or Number object that's used to insert white space into the output JSON string for readability purposes. - * @param {object} [options] Optional settings - * @param {boolean} [options.relaxed=true] Enabled Extended JSON's `relaxed` mode - * @param {boolean} [options.legacy=false] Output using the Extended JSON v1 spec - * @returns {string} + * @param value - The value to convert to extended JSON + * @param replacer - A function that alters the behavior of the stringification process, or an array of String and Number objects that serve as a whitelist for selecting/filtering the properties of the value object to be included in the JSON string. If this value is null or not provided, all properties of the object are included in the resulting JSON string + * @param space - A String or Number object that's used to insert white space into the output JSON string for readability purposes. + * @param options - Optional settings * * @example + * ```js * const { EJSON } = require('bson'); * const Int32 = require('mongodb').Int32; * const doc = { int32: new Int32(10) }; @@ -172,12 +196,16 @@ const BSON_INT32_MAX = 0x7fffffff, * * // prints '{"int32":10}' * console.log(EJSON.stringify(doc)); + * ``` */ +export function stringify(value: SerializableTypes): string; +export function stringify(value: SerializableTypes, options?: EJSONOptions): string; export function stringify( - value: any, - replacer?: (this: any, key: string, value: any) => any, + value: SerializableTypes, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + replacer?: (number | string)[] | ((this: any, key: string, value: any) => any) | EJSONOptions, space?: string | number, - options?: any + options?: EJSONOptions ): string { if (space != null && typeof space === 'object') { options = space; @@ -185,52 +213,50 @@ export function stringify( } if (replacer != null && typeof replacer === 'object' && !Array.isArray(replacer)) { options = replacer; - replacer = null; + replacer = undefined; space = 0; } options = Object.assign({}, { relaxed: true, legacy: false }, options); const doc = serializeValue(value, options); - return JSON.stringify(doc, replacer, space); + return JSON.stringify(doc, replacer as Parameters[1], space); } /** * Serializes an object to an Extended JSON string, and reparse it as a JavaScript object. * - * @memberof EJSON - * @param {object} bson The object to serialize - * @param {object} [options] Optional settings passed to the `stringify` function - * @return {object} + * @param value - The object to serialize + * @param options - Optional settings passed to the `stringify` function */ -export function serialize(bson, options) { +export function serialize(value: SerializableTypes, options?: EJSONOptions): Document { options = options || {}; - return JSON.parse(stringify(bson, options)); + return JSON.parse(stringify(value, options)); } /** * Deserializes an Extended JSON object into a plain JavaScript object with native/BSON types * - * @memberof EJSON - * @param {object} ejson The Extended JSON object to deserialize - * @param {object} [options] Optional settings passed to the parse method - * @return {object} + * @param ejson - The Extended JSON object to deserialize + * @param options - Optional settings passed to the parse method */ -export function deserialize(ejson, options) { +export function deserialize(ejson: Document, options?: EJSONOptions): SerializableTypes { options = options || {}; return parse(JSON.stringify(ejson), options); } -function serializeArray(array, options) { - return array.map(v => serializeValue(v, options)); +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeArray(array: any[], options: EJSONOptions): any[] { + return array.map((v: unknown) => serializeValue(v, options)); } -function getISOString(date) { +function getISOString(date: Date) { const isoStr = date.toISOString(); // we should only show milliseconds in timestamp if they're non-zero return date.getUTCMilliseconds() !== 0 ? isoStr : isoStr.slice(0, -5) + 'Z'; } -function serializeValue(value, options) { +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeValue(value: any, options: EJSONOptions): any { if (Array.isArray(value)) return serializeArray(value, options); if (value === undefined) return null; @@ -266,7 +292,10 @@ function serializeValue(value, options) { if (value instanceof RegExp) { let flags = value.flags; if (flags === undefined) { - flags = value.toString().match(/[gimuy]*$/)[0]; + const match = value.toString().match(/[gimuy]*$/); + if (match) { + flags = match[0]; + } } const rx = new BSONRegExp(value.source, flags); @@ -278,13 +307,19 @@ function serializeValue(value, options) { } const BSON_TYPE_MAPPINGS = { - Binary: o => new Binary(o.value(), o.subtype), - Code: o => new Code(o.code, o.scope), - DBRef: o => new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields), // "namespace" for 1.x library backwards compat - Decimal128: o => new Decimal128(o.bytes), - Double: o => new Double(o.value), - Int32: o => new Int32(o.value), - Long: o => + Binary: (o: Binary) => new Binary(o.value(), o.sub_type), + Code: (o: Code) => new Code(o.code, o.scope), + DBRef: (o: DBRef) => new DBRef(o.collection || o.namespace, o.oid, o.db, o.fields), // "namespace" for 1.x library backwards compat + Decimal128: (o: Decimal128) => new Decimal128(o.bytes), + Double: (o: Double) => new Double(o.value), + Int32: (o: Int32) => new Int32(o.value), + Long: ( + o: Long & { + low_: number; + high_: number; + unsigned_: boolean | undefined; + } + ) => Long.fromBits( // underscore variants for 1.x backwards compatibility o.low != null ? o.low : o.low_, @@ -293,47 +328,54 @@ const BSON_TYPE_MAPPINGS = { ), MaxKey: () => new MaxKey(), MinKey: () => new MinKey(), - ObjectID: o => new ObjectId(o), - ObjectId: o => new ObjectId(o), // support 4.0.0/4.0.1 before _bsontype was reverted back to ObjectID - BSONRegExp: o => new BSONRegExp(o.pattern, o.options), - Symbol: o => new BSONSymbol(o.value), - Timestamp: o => Timestamp.fromBits(o.low, o.high) -}; - -function serializeDocument(doc, options) { + ObjectID: (o: ObjectId) => new ObjectId(o), + ObjectId: (o: ObjectId) => new ObjectId(o), // support 4.0.0/4.0.1 before _bsontype was reverted back to ObjectID + BSONRegExp: (o: BSONRegExp) => new BSONRegExp(o.pattern, o.options), + Symbol: (o: BSONSymbol) => new BSONSymbol(o.value), + Timestamp: (o: Timestamp) => Timestamp.fromBits(o.low, o.high) +} as const; + +// eslint-disable-next-line @typescript-eslint/no-explicit-any +function serializeDocument(doc: any, options: EJSONOptions) { if (doc == null || typeof doc !== 'object') throw new Error('not an object instance'); - const bsontype = doc._bsontype; + const bsontype: BSONType['_bsontype'] = doc._bsontype; if (typeof bsontype === 'undefined') { // It's a regular object. Recursively serialize its property values. - const _doc = {}; + const _doc: Document = {}; for (const name in doc) { _doc[name] = serializeValue(doc[name], options); } return _doc; - } else if (typeof bsontype === 'string') { + } else if (isBSONType(doc)) { // the "document" is really just a BSON type object - let _doc = doc; - if (typeof _doc.toExtendedJSON !== 'function') { + // eslint-disable-next-line @typescript-eslint/no-explicit-any + let outDoc: any = doc; + if (typeof outDoc.toExtendedJSON !== 'function') { // There's no EJSON serialization function on the object. It's probably an // object created by a previous version of this library (or another library) // that's duck-typing objects to look like they were generated by this library). // Copy the object into this library's version of that type. - const mapper = BSON_TYPE_MAPPINGS[bsontype]; + const mapper = BSON_TYPE_MAPPINGS[doc._bsontype]; if (!mapper) { - throw new TypeError('Unrecognized or invalid _bsontype: ' + bsontype); + throw new TypeError('Unrecognized or invalid _bsontype: ' + doc._bsontype); } - _doc = mapper(_doc); + outDoc = mapper(outDoc); } // Two BSON types may have nested objects that may need to be serialized too - if (bsontype === 'Code' && _doc.scope) { - _doc = new Code(_doc.code, serializeValue(_doc.scope, options)); - } else if (bsontype === 'DBRef' && _doc.oid) { - _doc = new DBRef(_doc.collection, serializeValue(_doc.oid, options), _doc.db, _doc.fields); + if (bsontype === 'Code' && outDoc.scope) { + outDoc = new Code(outDoc.code, serializeValue(outDoc.scope, options)); + } else if (bsontype === 'DBRef' && outDoc.oid) { + outDoc = new DBRef( + outDoc.collection, + serializeValue(outDoc.oid, options), + outDoc.db, + outDoc.fields + ); } - return _doc.toExtendedJSON(options); + return outDoc.toExtendedJSON(options); } else { throw new Error('_bsontype must be a string, but was: ' + typeof bsontype); } diff --git a/src/float_parser.ts b/src/float_parser.ts index 1119ee80..c881f4cf 100644 --- a/src/float_parser.ts +++ b/src/float_parser.ts @@ -30,9 +30,17 @@ // // Modifications to writeIEEE754 to support negative zeroes made by Brian White -export function readIEEE754(buffer, offset, endian, mLen, nBytes) { - let e; - let m; +type NumericalSequence = { [index: number]: number }; + +export function readIEEE754( + buffer: NumericalSequence, + offset: number, + endian: 'big' | 'little', + mLen: number, + nBytes: number +): number { + let e: number; + let m: number; const bBE = endian === 'big'; const eLen = nBytes * 8 - mLen - 1; const eMax = (1 << eLen) - 1; @@ -65,10 +73,17 @@ export function readIEEE754(buffer, offset, endian, mLen, nBytes) { return (s ? -1 : 1) * m * Math.pow(2, e - mLen); } -export function writeIEEE754(buffer, value, offset, endian, mLen, nBytes) { - let e; - let m; - let c; +export function writeIEEE754( + buffer: NumericalSequence, + value: number, + offset: number, + endian: 'big' | 'little', + mLen: number, + nBytes: number +): void { + let e: number; + let m: number; + let c: number; const bBE = endian === 'big'; let eLen = nBytes * 8 - mLen - 1; const eMax = (1 << eLen) - 1; diff --git a/src/fnv1a.ts b/src/fnv1a.ts index 5add0480..13982adf 100644 --- a/src/fnv1a.ts +++ b/src/fnv1a.ts @@ -13,10 +13,10 @@ const FNV_MASK = new Long(MASK_32, 0); /** * Implementation of the FNV-1a hash for a 32-bit hash value * Algorithm can be found here: http://www.isthe.com/chongo/tech/comp/fnv/#FNV-1a - * @ignore + * @internal */ -export function fnv1a32(input, encoding) { - encoding = encoding || 'utf8'; +export function fnv1a32(input: string, encoding?: BufferEncoding): number { + encoding ??= 'utf8'; const octets = Buffer.from(input, encoding); let hash = OFFSET_BASIS; @@ -32,9 +32,9 @@ export function fnv1a32(input, encoding) { * Implements FNV-1a to generate 32-bit hash, then uses xor-folding * to convert to a 24-bit hash. See here for more info: * http://www.isthe.com/chongo/tech/comp/fnv/#xor-fold - * @ignore + * @internal */ -export function fnv1a24(input, encoding) { +export function fnv1a24(input: string, encoding?: BufferEncoding): number { const _32bit = fnv1a32(input, encoding); const base = _32bit & MASK_24; const top = (_32bit >>> 24) & MASK_8; diff --git a/src/int_32.ts b/src/int_32.ts index 6ec58972..ad567cbe 100644 --- a/src/int_32.ts +++ b/src/int_32.ts @@ -1,16 +1,17 @@ -/** - * A class representation of a BSON Int32 type. - */ +import type { EJSONOptions } from './extended_json'; + +/** A class representation of a BSON Int32 type. */ export class Int32 { + _bsontype!: 'Int32'; + value: number; /** * Create an Int32 type * - * @param {*} value the number we want to represent as an int32. - * @return {Int32} + * @param value - the number we want to represent as an int32. */ - constructor(value) { - if (value instanceof Number) { + constructor(value: number | string) { + if ((value as unknown) instanceof Number) { value = value.valueOf(); } @@ -20,32 +21,25 @@ export class Int32 { /** * Access the number value. * - * @method - * @return {number} returns the wrapped int32 number. + * @returns returns the wrapped int32 number. */ - valueOf() { + valueOf(): number { return this.value; } - /** - * @ignore - */ - toJSON() { + /** @internal */ + toJSON(): number { return this.value; } - /** - * @ignore - */ - toExtendedJSON(options) { + /** @internal */ + toExtendedJSON(options?: EJSONOptions): number | { $numberInt: string } { if (options && (options.relaxed || options.legacy)) return this.value; return { $numberInt: this.value.toString() }; } - /** - * @ignore - */ - static fromExtendedJSON(doc, options) { + /** @internal */ + static fromExtendedJSON(doc: { $numberInt: string }, options?: EJSONOptions): number | Int32 { return options && options.relaxed ? parseInt(doc.$numberInt, 10) : new Int32(doc.$numberInt); } } diff --git a/src/long.ts b/src/long.ts index a1348dc4..8a0b0aa0 100644 --- a/src/long.ts +++ b/src/long.ts @@ -1,1673 +1,926 @@ -/* eslint-disable no-var */ +import type { EJSONOptions } from './extended_json'; +import { isObjectLike } from './parser/utils'; + +interface LongWASMHelpers { + /** Gets the high bits of the last operation performed */ + get_high(): number; + div_u(lowBits: number, highBits: number, lowBitsDivisor: number, highBitsDivisor: number): number; + div_s(lowBits: number, highBits: number, lowBitsDivisor: number, highBitsDivisor: number): number; + rem_u(lowBits: number, highBits: number, lowBitsDivisor: number, highBitsDivisor: number): number; + rem_s(lowBits: number, highBits: number, lowBitsDivisor: number, highBitsDivisor: number): number; + mul( + lowBits: number, + highBits: number, + lowBitsMultiplier: number, + highBitsMultiplier: number + ): number; +} + /** * wasm optimizations, to do native i64 multiplication and divide */ -var wasm = null; +let wasm: LongWASMHelpers | undefined = undefined; + +/* We do not want to have to include DOM types just for this check */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any +declare const WebAssembly: any; try { - wasm = new WebAssembly.Instance( + wasm = (new WebAssembly.Instance( new WebAssembly.Module( // prettier-ignore 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 :( + ).exports as unknown) as LongWASMHelpers; +} catch { + // 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 +const TWO_PWR_16_DBL = 1 << 16; +const TWO_PWR_24_DBL = 1 << 24; +const TWO_PWR_32_DBL = TWO_PWR_16_DBL * TWO_PWR_16_DBL; +const TWO_PWR_64_DBL = TWO_PWR_32_DBL * TWO_PWR_32_DBL; +const TWO_PWR_63_DBL = TWO_PWR_64_DBL / 2; + +/** A cache of the Long representations of small integer values. */ +const INT_CACHE: { [key: number]: Long } = {}; + +/** A cache of the Long representations of small unsigned integer values. */ +const UINT_CACHE: { [key: number]: Long } = {}; + +/** + * A class representing a 64-bit integer + * @remarks + * 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 found as static properties on this class. */ export class Long { - __isLong__: true; - - constructor(low = 0, high = 0, unsigned?: boolean) { - /** - * 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; - } - - /** - * Maximum unsigned value. - */ - static MAX_UNSIGNED_VALUE: Long; - - /** - * Maximum signed value. - */ - static MAX_VALUE: Long; + _bsontype!: 'Long'; - /** - * Minimum signed value. - */ - static MIN_VALUE: Long; + /** An indicator used to reliably determine if an object is a Long or not. */ + __isLong__!: true; /** - * Signed negative one. + * The high 32 bits as a signed value. */ - static NEG_ONE: Long; + high: number; /** - * Signed one. + * The low 32 bits as a signed value. */ - static ONE: Long; + low: number; /** - * Unsigned one. + * Whether unsigned or not. */ - static UONE: Long; + unsigned: boolean; /** - * Unsigned zero. + * 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. + * @param low - The low (signed) 32 bits of the long + * @param high - The high (signed) 32 bits of the long + * @param unsigned - Whether unsigned or not, defaults to signed */ - static UZERO: Long; + constructor(low = 0, high = 0, unsigned?: boolean) { + this.low = low | 0; + this.high = high | 0; + this.unsigned = !!unsigned; - /** - * Signed zero - */ - static ZERO: Long; + Object.defineProperty(this, '__isLong__', { + value: true, + configurable: false, + writable: false, + enumerable: false + }); + } - /** - * 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; + static TWO_PWR_24 = Long.fromInt(TWO_PWR_24_DBL); + + /** Maximum unsigned value. */ + static MAX_UNSIGNED_VALUE = Long.fromBits(0xffffffff | 0, 0xffffffff | 0, true); + /** Signed zero */ + static ZERO = Long.fromInt(0); + /** Unsigned zero. */ + static UZERO = Long.fromInt(0, true); + /** Signed one. */ + static ONE = Long.fromInt(1); + /** Unsigned one. */ + static UONE = Long.fromInt(1, true); + /** Signed negative one. */ + static NEG_ONE = Long.fromInt(-1); + /** Maximum signed value. */ + static MAX_VALUE = Long.fromBits(0xffffffff | 0, 0x7fffffff | 0, false); + /** Minimum signed value. */ + static MIN_VALUE = Long.fromBits(0, 0x80000000 | 0, false); + + /** + * 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. + * @param lowBits - The low 32 bits + * @param highBits - The high 32 bits + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBits(lowBits: number, highBits: number, unsigned?: boolean): Long { + return new Long(lowBits, highBits, unsigned); + } /** * Returns a Long representing the given 32 bit integer value. - */ - static fromInt: (value: number, unsigned?: boolean) => Long; + * @param value - The 32 bit integer in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromInt(value: number, unsigned?: boolean): Long { + let obj, cachedObj, cache; + if (unsigned) { + value >>>= 0; + if ((cache = 0 <= value && value < 256)) { + cachedObj = UINT_CACHE[value]; + if (cachedObj) return cachedObj; + } + obj = Long.fromBits(value, (value | 0) < 0 ? -1 : 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 = Long.fromBits(value, value < 0 ? -1 : 0, false); + if (cache) INT_CACHE[value] = obj; + return obj; + } + } /** * 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; + * @param value - The number in question + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromNumber(value: number, unsigned?: boolean): Long { + if (isNaN(value)) return unsigned ? Long.UZERO : Long.ZERO; + if (unsigned) { + if (value < 0) return Long.UZERO; + if (value >= TWO_PWR_64_DBL) return Long.MAX_UNSIGNED_VALUE; + } else { + if (value <= -TWO_PWR_63_DBL) return Long.MIN_VALUE; + if (value + 1 >= TWO_PWR_63_DBL) return Long.MAX_VALUE; + } + if (value < 0) return Long.fromNumber(-value, unsigned).neg(); + return Long.fromBits(value % TWO_PWR_32_DBL | 0, (value / TWO_PWR_32_DBL) | 0, unsigned); + } /** * Returns a Long representation of the given string, written using the specified radix. - */ - static fromString: (str: string, unsigned?: boolean | number, radix?: number) => Long; + * @param str - The textual representation of the Long + * @param unsigned - Whether unsigned or not, defaults to signed + * @param radix - The radix in which the text is written (2-36), defaults to 10 + * @returns The corresponding Long value + */ + static fromString(str: string, unsigned?: boolean, radix?: number): Long { + if (str.length === 0) throw Error('empty string'); + if (str === 'NaN' || str === 'Infinity' || str === '+Infinity' || str === '-Infinity') + return Long.ZERO; + if (typeof unsigned === 'number') { + // For goog.math.long compatibility + (radix = unsigned), (unsigned = false); + } else { + unsigned = !!unsigned; + } + radix = radix || 10; + if (radix < 2 || 36 < radix) throw RangeError('radix'); + + let p; + if ((p = str.indexOf('-')) > 0) throw Error('interior hyphen'); + else if (p === 0) { + return Long.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. + const radixToPower = Long.fromNumber(Math.pow(radix, 8)); + + let result = Long.ZERO; + for (let i = 0; i < str.length; i += 8) { + const size = Math.min(8, str.length - i), + value = parseInt(str.substring(i, i + size), radix); + if (size < 8) { + const power = Long.fromNumber(Math.pow(radix, size)); + result = result.mul(power).add(Long.fromNumber(value)); + } else { + result = result.mul(radixToPower); + result = result.add(Long.fromNumber(value)); + } + } + result.unsigned = unsigned; + return result; + } /** * Creates a Long from its byte representation. + * @param bytes - Byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @param le - Whether little or big endian, defaults to big endian + * @returns The corresponding Long value */ - static fromBytes: (bytes: number[], unsigned?: boolean, le?: boolean) => Long; + static fromBytes(bytes: number[], unsigned?: boolean, le?: boolean): Long { + return le ? Long.fromBytesLE(bytes, unsigned) : Long.fromBytesBE(bytes, unsigned); + } /** * Creates a Long from its little endian byte representation. - */ - static fromBytesLE: (bytes: number[], unsigned?: boolean) => Long; + * @param bytes - Little endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value + */ + static fromBytesLE(bytes: number[], unsigned?: boolean): Long { + 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 little endian byte representation. + * Creates a Long from its big endian byte representation. + * @param bytes - Big endian byte representation + * @param unsigned - Whether unsigned or not, defaults to signed + * @returns The corresponding Long value */ - static fromBytesBE: (bytes: number[], unsigned?: boolean) => Long; + static fromBytesBE(bytes: number[], unsigned?: boolean): Long { + 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 + ); + } /** * Tests if the specified object is a Long. */ - static isLong: (obj: any) => obj is Long; + static isLong(value: unknown): value is Long { + return isObjectLike(value) && value['__isLong__'] === true; + } /** * Converts the specified value to a Long. - */ - static fromValue: ( - val: Long | number | string | { low: number; high: number; unsigned: boolean } - ) => Long; + * @param unsigned - Whether unsigned or not, defaults to signed + */ + static fromValue( + val: number | string | { low: number; high: number; unsigned?: boolean }, + unsigned?: boolean + ): Long { + if (typeof val === 'number') return Long.fromNumber(val, unsigned); + if (typeof val === 'string') return Long.fromString(val, unsigned); + // Throws for non-objects, converts non-instanceof Long: + return Long.fromBits( + val.low, + val.high, + typeof unsigned === 'boolean' ? unsigned : val.unsigned + ); + } - /** - * The high 32 bits as a signed value. - */ - high: number; + /** Returns the sum of this and the specified Long. */ + add(addend: string | number | Long): Long { + if (!Long.isLong(addend)) addend = Long.fromValue(addend); + + // Divide each number into 4 chunks of 16 bits, and then sum the chunks. + + const a48 = this.high >>> 16; + const a32 = this.high & 0xffff; + const a16 = this.low >>> 16; + const a00 = this.low & 0xffff; + + const b48 = addend.high >>> 16; + const b32 = addend.high & 0xffff; + const b16 = addend.low >>> 16; + const b00 = addend.low & 0xffff; + + let 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 Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + } /** - * The low 32 bits as a signed value. + * Returns the sum of this and the specified Long. + * @returns Sum */ - low: number; + and(other: string | number | Long): Long { + if (!Long.isLong(other)) other = Long.fromValue(other); + return Long.fromBits(this.low & other.low, this.high & other.high, this.unsigned); + } /** - * Whether unsigned or not. - */ - unsigned: boolean; + * 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 + */ + compare(other: string | number | Long): 0 | 1 | -1 { + if (!Long.isLong(other)) other = Long.fromValue(other); + if (this.eq(other)) return 0; + const 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; + } - /** - * Returns the sum of this and the specified Long. - */ - add: (addend: number | Long | string) => Long; + /** This is an alias of {@link Long.compare} */ + comp = Long.prototype.compare; + + /** + * Returns this Long divided by the specified. The result is signed if this Long is signed or unsigned if this Long is unsigned. + * @returns Quotient + */ + divide(divisor: string | number | Long): Long { + if (!Long.isLong(divisor)) divisor = Long.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; + } + const low = (this.unsigned ? wasm.div_u : wasm.div_s)( + this.low, + this.high, + divisor.low, + divisor.high + ); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } - /** - * Returns the bitwise AND of this Long and the specified. - */ - and: (other: Long | number | string) => Long; + if (this.isZero()) return this.unsigned ? Long.UZERO : Long.ZERO; + let 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(Long.MIN_VALUE)) { + if (divisor.eq(Long.ONE) || divisor.eq(Long.NEG_ONE)) return Long.MIN_VALUE; + // recall that -MIN_VALUE == MIN_VALUE + else if (divisor.eq(Long.MIN_VALUE)) return Long.ONE; + else { + // At this point, we have |other| >= 2, so |this/other| < |MIN_VALUE|. + const halfThis = this.shr(1); + approx = halfThis.div(divisor).shl(1); + if (approx.eq(Long.ZERO)) { + return divisor.isNegative() ? Long.ONE : Long.NEG_ONE; + } else { + rem = this.sub(divisor.mul(approx)); + res = approx.add(rem.div(divisor)); + return res; + } + } + } else if (divisor.eq(Long.MIN_VALUE)) return this.unsigned ? Long.UZERO : Long.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 = Long.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 Long.UZERO; + if (divisor.gt(this.shru(1))) + // 15 >>> 1 = 7 ; with divisor = 8 ; true + return Long.UONE; + res = Long.UZERO; + } - /** - * Compares this Long's value with the specified's. - */ - compare: (other: Long | number | string) => number; + // 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. + const log2 = Math.ceil(Math.log(approx) / Math.LN2); + const delta = log2 <= 48 ? 1 : Math.pow(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. + let approxRes = Long.fromNumber(approx); + let approxRem = approxRes.mul(divisor); + while (approxRem.isNegative() || approxRem.gt(rem)) { + approx -= delta; + approxRes = Long.fromNumber(approx, this.unsigned); + approxRem = approxRes.mul(divisor); + } - /** - * Compares this Long's value with the specified's. - */ - comp: (other: Long | number | string) => number; + // 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 = Long.ONE; - /** - * Returns this Long divided by the specified. - */ - divide: (divisor: Long | number | string) => Long; + res = res.add(approxRes); + rem = rem.sub(approxRem); + } + return res; + } - /** - * Returns this Long divided by the specified. - */ - div: (divisor: Long | number | string) => Long; + /**This is an alias of {@link Long.divide} */ + div = Long.prototype.divide; /** * Tests if this Long's value equals the specified's. + * @param other - Other value */ - equals: (other: Long | number | string) => boolean; + equals(other: string | number | Long): boolean { + if (!Long.isLong(other)) other = Long.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. - */ - eq: (other: Long | number | string) => boolean; + /** This is an alias of {@link Long.equals} */ + eq = Long.prototype.equals; - /** - * Gets the high 32 bits as a signed integer. - */ - getHighBits: () => number; + /** Gets the high 32 bits as a signed integer. */ + getHighBits(): number { + return this.high; + } - /** - * Gets the high 32 bits as an unsigned integer. - */ - getHighBitsUnsigned: () => number; + /** Gets the high 32 bits as an unsigned integer. */ + getHighBitsUnsigned(): number { + return this.high >>> 0; + } - /** - * Gets the low 32 bits as a signed integer. - */ - getLowBits: () => number; + /** Gets the low 32 bits as a signed integer. */ + getLowBits(): number { + return this.low; + } - /** - * Gets the low 32 bits as an unsigned integer. - */ - getLowBitsUnsigned: () => number; + /** Gets the low 32 bits as an unsigned integer. */ + getLowBitsUnsigned(): number { + return this.low >>> 0; + } - /** - * Gets the number of bits needed to represent the absolute value of this Long. - */ - getNumBitsAbs: () => number; + /** Gets the number of bits needed to represent the absolute value of this Long. */ + getNumBitsAbs(): number { + if (this.isNegative()) { + // Unsigned Longs are never negative + return this.eq(Long.MIN_VALUE) ? 64 : this.neg().getNumBitsAbs(); + } + const val = this.high !== 0 ? this.high : this.low; + let bit: number; + for (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 is greater than the specified's. - */ - greaterThan: (other: Long | number | string) => boolean; + /** Tests if this Long's value is greater than the specified's. */ + greaterThan(other: string | number | Long): boolean { + return this.comp(other) > 0; + } - /** - * Tests if this Long's value is greater than the specified's. - */ - gt: (other: Long | number | string) => boolean; + /** This is an alias of {@link Long.greaterThan} */ + gt = Long.prototype.greaterThan; - /** - * 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. */ + greaterThanOrEqual(other: string | number | Long): boolean { + return this.comp(other) >= 0; + } - /** - * Tests if this Long's value is greater than or equal the specified's. - */ - gte: (other: Long | number | string) => boolean; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + gte = Long.prototype.greaterThanOrEqual; + /** This is an alias of {@link Long.greaterThanOrEqual} */ + ge = Long.prototype.greaterThanOrEqual; - /** - * Tests if this Long's value is even. - */ - isEven: () => boolean; + /** Tests if this Long's value is even. */ + isEven(): boolean { + return (this.low & 1) === 0; + } - /** - * Tests if this Long's value is negative. - */ - isNegative: () => boolean; + /** Tests if this Long's value is negative. */ + isNegative(): boolean { + return !this.unsigned && this.high < 0; + } - /** - * Tests if this Long's value is odd. - */ - isOdd: () => boolean; + /** Tests if this Long's value is odd. */ + isOdd(): boolean { + return (this.low & 1) === 1; + } - /** - * Tests if this Long's value is positive. - */ - isPositive: () => boolean; + /** Tests if this Long's value is positive. */ + isPositive(): boolean { + return this.unsigned || this.high >= 0; + } - /** - * Tests if this Long's value equals zero. - */ - isZero: () => boolean; + /** Tests if this Long's value equals zero. */ + isZero(): boolean { + return this.high === 0 && this.low === 0; + } - /** - * 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. */ + lessThan(other: string | number | Long): boolean { + return this.comp(other) < 0; + } - /** - * Tests if this Long's value is less than the specified's. - */ - lt: (other: Long | number | string) => boolean; + /** This is an alias of {@link Long#lessThan}. */ + lt = Long.prototype.lessThan; - /** - * 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. */ + lessThanOrEqual(other: string | number | Long): boolean { + return this.comp(other) <= 0; + } - /** - * Tests if this Long's value is less than or equal the specified's. - */ - lte: (other: Long | number | string) => boolean; + /** This is an alias of {@link Long.lessThanOrEqual} */ + lte = Long.prototype.lessThanOrEqual; - /** - * Returns this Long modulo the specified. - */ - modulo: (other: Long | number | string) => Long; + /** Returns this Long modulo the specified. */ + modulo(divisor: string | number | Long): Long { + if (!Long.isLong(divisor)) divisor = Long.fromValue(divisor); - /** - * Returns this Long modulo the specified. - */ - mod: (other: Long | number | string) => Long; + // use wasm support if present + if (wasm) { + const low = (this.unsigned ? wasm.rem_u : wasm.rem_s)( + this.low, + this.high, + divisor.low, + divisor.high + ); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } - /** - * Returns the product of this and the specified Long. - */ - multiply: (multiplier: Long | number | string) => Long; + return this.sub(this.div(divisor).mul(divisor)); + } + + /** This is an alias of {@link Long.modulo} */ + mod = Long.prototype.modulo; + /** This is an alias of {@link Long.modulo} */ + rem = Long.prototype.modulo; /** * Returns the product of this and the specified Long. + * @param multiplier - Multiplier + * @returns Product */ - mul: (multiplier: Long | number | string) => Long; + multiply(multiplier: string | number | Long): Long { + if (this.isZero()) return Long.ZERO; + if (!Long.isLong(multiplier)) multiplier = Long.fromValue(multiplier); - /** - * Negates this Long's value. - */ - negate: () => Long; + // use wasm support if present + if (wasm) { + const low = wasm.mul(this.low, this.high, multiplier.low, multiplier.high); + return Long.fromBits(low, wasm.get_high(), this.unsigned); + } - /** - * Negates this Long's value. - */ - neg: () => Long; + if (multiplier.isZero()) return Long.ZERO; + if (this.eq(Long.MIN_VALUE)) return multiplier.isOdd() ? Long.MIN_VALUE : Long.ZERO; + if (multiplier.eq(Long.MIN_VALUE)) return this.isOdd() ? Long.MIN_VALUE : Long.ZERO; - /** - * Returns the bitwise NOT of this Long. - */ - not: () => Long; + 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(Long.TWO_PWR_24) && multiplier.lt(Long.TWO_PWR_24)) + return Long.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. + + const a48 = this.high >>> 16; + const a32 = this.high & 0xffff; + const a16 = this.low >>> 16; + const a00 = this.low & 0xffff; + + const b48 = multiplier.high >>> 16; + const b32 = multiplier.high & 0xffff; + const b16 = multiplier.low >>> 16; + const b00 = multiplier.low & 0xffff; + + let 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 Long.fromBits((c16 << 16) | c00, (c48 << 16) | c32, this.unsigned); + } - /** - * Tests if this Long's value differs from the specified's. - */ - notEquals: (other: Long | number | string) => boolean; + /** This is an alias of {@link Long.multiply} */ + mul = Long.prototype.multiply; - /** - * Tests if this Long's value differs from the specified's. - */ - neq: (other: Long | number | string) => boolean; + /** Returns the Negation of this Long's value. */ + negate(): Long { + if (!this.unsigned && this.eq(Long.MIN_VALUE)) return Long.MIN_VALUE; + return this.not().add(Long.ONE); + } + + /** This is an alias of {@link Long.negate} */ + neg = Long.prototype.negate; + + /** Returns the bitwise NOT of this Long. */ + not(): Long { + return Long.fromBits(~this.low, ~this.high, this.unsigned); + } + + /** Tests if this Long's value differs from the specified's. */ + notEquals(other: string | number | Long): boolean { + return !this.equals(other); + } + + /** This is an alias of {@link Long.notEquals} */ + neq = Long.prototype.notEquals; + /** This is an alias of {@link Long.notEquals} */ + ne = Long.prototype.notEquals; /** * Returns the bitwise OR of this Long and the specified. */ - or: (other: Long | number | string) => Long; + or(other: number | string | Long): Long { + if (!Long.isLong(other)) other = Long.fromValue(other); + return Long.fromBits(this.low | other.low, this.high | other.high, this.unsigned); + } /** * Returns this Long with bits shifted to the left by the given amount. - */ - shiftLeft: (numBits: number | Long) => Long; + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftLeft(numBits: number | Long): Long { + if (Long.isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + else if (numBits < 32) + return Long.fromBits( + this.low << numBits, + (this.high << numBits) | (this.low >>> (32 - numBits)), + this.unsigned + ); + else return Long.fromBits(0, this.low << (numBits - 32), this.unsigned); + } - /** - * Returns this Long with bits shifted to the left by the given amount. - */ - shl: (numBits: number | Long) => Long; + /** This is an alias of {@link Long.shiftLeft} */ + shl = Long.prototype.shiftLeft; /** * Returns this Long with bits arithmetically shifted to the right by the given amount. - */ - shiftRight: (numBits: number | Long) => Long; + * @param numBits - Number of bits + * @returns Shifted Long + */ + shiftRight(numBits: number | Long): Long { + if (Long.isLong(numBits)) numBits = numBits.toInt(); + if ((numBits &= 63) === 0) return this; + else if (numBits < 32) + return Long.fromBits( + (this.low >>> numBits) | (this.high << (32 - numBits)), + this.high >> numBits, + this.unsigned + ); + else return Long.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. - */ - shr: (numBits: number | Long) => Long; + /** This is an alias of {@link Long.shiftRight} */ + shr = Long.prototype.shiftRight; /** * Returns this Long with bits logically shifted to the right by the given amount. + * @param numBits - Number of bits + * @returns Shifted Long */ - shiftRightUnsigned: (numBits: number | Long) => Long; + shiftRightUnsigned(numBits: Long | number): Long { + if (Long.isLong(numBits)) numBits = numBits.toInt(); + numBits &= 63; + if (numBits === 0) return this; + else { + const high = this.high; + if (numBits < 32) { + const low = this.low; + return Long.fromBits( + (low >>> numBits) | (high << (32 - numBits)), + high >>> numBits, + this.unsigned + ); + } else if (numBits === 32) return Long.fromBits(high, 0, this.unsigned); + else return Long.fromBits(high >>> (numBits - 32), 0, this.unsigned); + } + } - /** - * Returns this Long with bits logically shifted to the right by the given amount. - */ - shru: (numBits: number | Long) => Long; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + shr_u = Long.prototype.shiftRightUnsigned; + /** This is an alias of {@link Long.shiftRightUnsigned} */ + shru = Long.prototype.shiftRightUnsigned; /** * Returns the difference of this and the specified Long. + * @param subtrahend - Subtrahend + * @returns Difference */ - subtract: (subtrahend: number | Long | string) => Long; + subtract(subtrahend: string | number | Long): Long { + if (!Long.isLong(subtrahend)) subtrahend = Long.fromValue(subtrahend); + return this.add(subtrahend.neg()); + } - /** - * Returns the difference of this and the specified Long. - */ - sub: (subtrahend: number | Long | string) => Long; + /** This is an alias of {@link Long.subtract} */ + sub = Long.prototype.subtract; - /** - * Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. - */ - toInt: () => number; + /** Converts the Long to a 32 bit integer, assuming it is a 32 bit integer. */ + toInt(): number { + 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). - */ - toNumber: () => number; + /** Converts the Long to a the nearest floating-point representation of this value (double, 53 bit mantissa). */ + toNumber(): number { + 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 this Long to its byte representation. + * @param le - Whether little or big endian, defaults to big endian + * @returns Byte representation */ - - toBytes: (le?: boolean) => number[]; + toBytes(le?: boolean): number[] { + return le ? this.toBytesLE() : this.toBytesBE(); + } /** * Converts this Long to its little endian byte representation. - */ - - toBytesLE: () => number[]; + * @returns Little endian byte representation + */ + toBytesLE(): number[] { + const 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. - */ - - toBytesBE: () => number[]; + * @returns Big endian byte representation + */ + toBytesBE(): number[] { + const 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 + ]; + } /** * Converts this Long to signed. */ - toSigned = () => Long; + toSigned(): Long { + if (!this.unsigned) return this; + return Long.fromBits(this.low, this.high, false); + } /** * Converts the Long to a string written in the specified radix. + * @param radix - Radix (2-36), defaults to 10 + * @throws RangeError If `radix` is out of range */ - toString: (radix?: number) => string; + toString(radix?: number): string { + 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(Long.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. + const radixLong = Long.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); + } - /** - * Converts this Long to unsigned. - */ - toUnsigned: () => Long; + // Do several (6) digits each time through the loop, so as to + // minimize the calls to the very expensive emulated div. + const radixToPower = Long.fromNumber(Math.pow(radix, 6), this.unsigned); + // eslint-disable-next-line @typescript-eslint/no-this-alias + let rem: Long = this; + let result = ''; + // eslint-disable-next-line no-constant-condition + while (true) { + const remDiv = rem.div(radixToPower); + const intval = rem.sub(remDiv.mul(radixToPower)).toInt() >>> 0; + let digits = intval.toString(radix); + rem = remDiv; + if (rem.isZero()) { + return digits + result; + } else { + while (digits.length < 6) digits = '0' + digits; + result = '' + digits + result; + } + } + } - /** - * Returns the bitwise XOR of this Long and the given one. - */ - xor: (other: Long | number | string) => Long; + /** Converts this Long to unsigned. */ + toUnsigned(): Long { + if (this.unsigned) return this; + return Long.fromBits(this.low, this.high, true); + } + + /** Returns the bitwise XOR of this Long and the given one. */ + xor(other: Long | number | string): Long { + if (!Long.isLong(other)) other = Long.fromValue(other); + return Long.fromBits(this.low ^ other.low, this.high ^ other.high, this.unsigned); + } + + /** This is an alias of {@link Long.isZero} */ + eqz = Long.prototype.isZero; - eqz: Long['isZero']; - ne: Long['notEquals']; - le: Long['lessThanOrEqual']; - ge: Long['greaterThanOrEqual']; - rem: Long['modulo']; - shr_u: Long['shiftRightUnsigned']; + /** This is an alias of {@link Long.lessThanOrEqual} */ + le = Long.prototype.lessThanOrEqual; /* **************************************************************** * BSON SPECIFIC ADDITIONS * **************************************************************** */ - toExtendedJSON(options): any { + toExtendedJSON(options?: EJSONOptions): number | { $numberLong: string } { if (options && options.relaxed) return this.toNumber(); return { $numberLong: this.toString() }; } - static fromExtendedJSON(doc, options) { + static fromExtendedJSON(doc: { $numberLong: string }, options?: EJSONOptions): number | Long { const result = Long.fromString(doc.$numberLong); return options && options.relaxed ? result.toNumber() : result; } } -// 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): obj is Long { - return (obj && obj['__isLong__']) === true; -} - -/** - * 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?: boolean) { - 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, (value | 0) < 0 ? -1 : 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?: boolean) { - 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?: boolean, radix?: number) { - if (str.length === 0) throw Error('empty string'); - if (str === 'NaN' || str === 'Infinity' || str === '+Infinity' || str === '-Infinity') - return ZERO; - if (typeof unsigned === 'number') { - // For goog.math.long compatibility - (radix = unsigned), (unsigned = false); - } else { - unsigned = !!unsigned; - } - 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?: boolean) { - 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. - * @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). - * @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. - * @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?: number) { - 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), - // eslint-disable-next-line @typescript-eslint/no-this-alias - rem = this; - var result = ''; - // eslint-disable-next-line no-constant-condition - 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. - * @returns {number} Signed high bits - */ -LongPrototype.getHighBits = function getHighBits() { - return this.high; -}; - -/** - * Gets the high 32 bits as an unsigned integer. - * @returns {number} Unsigned high bits - */ -LongPrototype.getHighBitsUnsigned = function getHighBitsUnsigned() { - return this.high >>> 0; -}; - -/** - * Gets the low 32 bits as a signed integer. - * @returns {number} Signed low bits - */ -LongPrototype.getLowBits = function getLowBits() { - return this.low; -}; - -/** - * Gets the low 32 bits as an unsigned integer. - * @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. - * @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. - * @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. - * @returns {boolean} - */ -LongPrototype.isNegative = function isNegative() { - return !this.unsigned && this.high < 0; -}; - -/** - * Tests if this Long's value is positive. - * @returns {boolean} - */ -LongPrototype.isPositive = function isPositive() { - return this.unsigned || this.high >= 0; -}; - -/** - * Tests if this Long's value is odd. - * @returns {boolean} - */ -LongPrototype.isOdd = function isOdd() { - return (this.low & 1) === 1; -}; - -/** - * Tests if this Long's value is even. - * @returns {boolean} - */ -LongPrototype.isEven = function isEven() { - return (this.low & 1) === 0; -}; - -/** - * Tests if this Long's value equals the specified's. - * @param {!Long|number|string} other Other value - * @returns {boolean} - */ -LongPrototype.equals = function equals(_other) { - let other: Long = _other as Long; - 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. - * @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. - * @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. - * @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. - * @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. - * @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. - * @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) { - let other: Long = _other as Long; - 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. - * @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. - * @param {!Long|number|string} addend Addend - * @returns {!Long} Sum - */ -LongPrototype.add = function add(_addend) { - let addend: Long = _addend as Long; - 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. - * @param {!Long|number|string} subtrahend Subtrahend - * @returns {!Long} Difference - */ -LongPrototype.subtract = function subtract(_subtrahend) { - let subtrahend: Long = _subtrahend as Long; - 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. - * @param {!Long|number|string} multiplier Multiplier - * @returns {!Long} Product - */ -LongPrototype.multiply = function multiply(_multiplier) { - let multiplier: Long = _multiplier as Long; - if (this.isZero()) return ZERO; - 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 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. - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Quotient - */ -LongPrototype.divide = function divide(_divisor) { - let divisor: Long = _divisor as Long; - 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. - * @param {!Long|number|string} divisor Divisor - * @returns {!Long} Remainder - */ -LongPrototype.modulo = function modulo(_divisor) { - let divisor: Long = _divisor as Long; - 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. - * @returns {!Long} - */ -LongPrototype.not = function not() { - return fromBits(~this.low, ~this.high, this.unsigned); -}; - -/** - * Returns the bitwise AND of this Long and the specified. - * @param {!Long|number|string} other Other Long - * @returns {!Long} - */ -LongPrototype.and = function and(_other) { - let other: Long = _other as Long; - 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. - * @param {!Long|number|string} other Other Long - * @returns {!Long} - */ -LongPrototype.or = function or(_other) { - let other: Long = _other as Long; - 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. - * @param {!Long|number|string} other Other Long - * @returns {!Long} - */ -LongPrototype.xor = function xor(_other) { - let other: Long = _other as Long; - 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. - * @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. - * @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. - * @param {number|!Long} numBits Number of bits - * @returns {!Long} Shifted Long - */ -LongPrototype.shiftRightUnsigned = function shiftRightUnsigned(numBits) { - if (isLong(numBits)) numBits = numBits.toInt(); - numBits &= 63; - if (numBits === 0) return this; - else { - var high = this.high; - if (numBits < 32) { - var low = this.low; - return fromBits( - (low >>> numBits) | (high << (32 - numBits)), - high >>> numBits, - this.unsigned - ); - } else if (numBits === 32) return fromBits(high, 0, this.unsigned); - else return fromBits(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; - -/** - * Converts this Long to signed. - * @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. - * @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 - * @returns {!Array.} Byte representation - */ -LongPrototype.toBytes = function toBytes(le) { - return le ? this.toBytesLE() : this.toBytesBE(); -}; - -/** - * Converts this Long to its little endian byte representation. - * @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. - * @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 - ); -}; - Object.defineProperty(Long.prototype, '_bsontype', { value: 'Long' }); diff --git a/src/map.ts b/src/map.ts index bb0f676b..1b544463 100644 --- a/src/map.ts +++ b/src/map.ts @@ -1,5 +1,10 @@ +/* eslint-disable @typescript-eslint/no-explicit-any */ // We have an ES6 Map available, return the native instance +/* We do not want to have to include DOM types just for this check */ +declare const window: unknown; +declare const self: unknown; + let bsonMap: MapConstructor; const check = function (potentialGlobal: any) { @@ -24,118 +29,109 @@ if (Object.prototype.hasOwnProperty.call(bsonGlobal, 'Map')) { bsonMap = bsonGlobal.Map; } else { // We will return a polyfill - bsonMap = (function Map(array) { - this._keys = []; - this._values = {}; - - for (let i = 0; i < array.length; i++) { - if (array[i] == null) continue; // skip null and undefined - const entry = array[i]; - const key = entry[0]; - const value = entry[1]; - // Add the key to the list of keys in order - this._keys.push(key); - // Add the key and value to the values dictionary with a point - // to the location in the ordered keys list - this._values[key] = { v: value, i: this._keys.length - 1 }; + bsonMap = (class Map { + private _keys: string[]; + private _values: Record; + constructor(array: [string, any][] = []) { + this._keys = []; + this._values = {}; + + for (let i = 0; i < array.length; i++) { + if (array[i] == null) continue; // skip null and undefined + const entry = array[i]; + const key = entry[0]; + const value = entry[1]; + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; + } } - } as unknown) as MapConstructor; - - bsonMap.prototype.clear = function () { - this._keys = []; - this._values = {}; - }; - - bsonMap.prototype.delete = function (key) { - const value = this._values[key]; - if (value == null) return false; - // Delete entry - delete this._values[key]; - // Remove the key from the ordered keys list - this._keys.splice(value.i, 1); - return true; - }; - - bsonMap.prototype.entries = function () { - let index = 0; + clear() { + this._keys = []; + this._values = {}; + } + delete(key: string) { + const value = this._values[key]; + if (value == null) return false; + // Delete entry + delete this._values[key]; + // Remove the key from the ordered keys list + this._keys.splice(value.i, 1); + return true; + } + entries() { + let index = 0; + + return { + next: () => { + const key = this._keys[index++]; + return { + value: key !== undefined ? [key, this._values[key].v] : undefined, + done: key !== undefined ? false : true + }; + } + }; + } + forEach(callback: (this: this, value: any, key: string, self: this) => void, self?: this) { + self = self || this; - return { - next: () => { - const key = this._keys[index++]; - return { - value: key !== undefined ? [key, this._values[key].v] : undefined, - done: key !== undefined ? false : true - }; + for (let i = 0; i < this._keys.length; i++) { + const key = this._keys[i]; + // Call the forEach callback + callback.call(self, this._values[key].v, key, self); } - }; - } as any; - - bsonMap.prototype.forEach = function (callback, self) { - self = self || this; - - for (let i = 0; i < this._keys.length; i++) { - const key = this._keys[i]; - // Call the forEach callback - callback.call(self, this._values[key].v, key, self); } - }; - - bsonMap.prototype.get = function (key) { - return this._values[key] ? this._values[key].v : undefined; - }; - - bsonMap.prototype.has = function (key) { - return this._values[key] != null; - }; - - bsonMap.prototype.keys = function () { - let index = 0; - - return { - next: () => { - const key = this._keys[index++]; - return { - value: key !== undefined ? key : undefined, - done: key !== undefined ? false : true - }; + get(key: string) { + return this._values[key] ? this._values[key].v : undefined; + } + has(key: string) { + return this._values[key] != null; + } + keys() { + let index = 0; + + return { + next: () => { + const key = this._keys[index++]; + return { + value: key !== undefined ? key : undefined, + done: key !== undefined ? false : true + }; + } + }; + } + set(key: string, value: any) { + if (this._values[key]) { + this._values[key].v = value; + return this; } - }; - } as any; - bsonMap.prototype.set = function (key, value) { - if (this._values[key]) { - this._values[key].v = value; + // Add the key to the list of keys in order + this._keys.push(key); + // Add the key and value to the values dictionary with a point + // to the location in the ordered keys list + this._values[key] = { v: value, i: this._keys.length - 1 }; return this; } - - // Add the key to the list of keys in order - this._keys.push(key); - // Add the key and value to the values dictionary with a point - // to the location in the ordered keys list - this._values[key] = { v: value, i: this._keys.length - 1 }; - return this; - }; - - bsonMap.prototype.values = function () { - let index = 0; - - return { - next: () => { - const key = this._keys[index++]; - return { - value: key !== undefined ? this._values[key].v : undefined, - done: key !== undefined ? false : true - }; - } - }; - } as any; - - Object.defineProperty(Map.prototype, 'size', { - enumerable: true, - get: function () { + values() { + let index = 0; + + return { + next: () => { + const key = this._keys[index++]; + return { + value: key !== undefined ? this._values[key].v : undefined, + done: key !== undefined ? false : true + }; + } + }; + } + get size() { return this._keys.length; } - }); + } as unknown) as MapConstructor; } export { bsonMap as Map }; diff --git a/src/max_key.ts b/src/max_key.ts index 86fedf98..6f118fd5 100644 --- a/src/max_key.ts +++ b/src/max_key.ts @@ -2,17 +2,15 @@ * A class representation of the BSON MaxKey type. */ export class MaxKey { - /** - * @ignore - */ - toExtendedJSON() { + _bsontype!: 'MaxKey'; + + /** @internal */ + toExtendedJSON(): { $maxKey: 1 } { return { $maxKey: 1 }; } - /** - * @ignore - */ - static fromExtendedJSON() { + /** @internal */ + static fromExtendedJSON(): MaxKey { return new MaxKey(); } } diff --git a/src/min_key.ts b/src/min_key.ts index 22edb00c..2344e4f5 100644 --- a/src/min_key.ts +++ b/src/min_key.ts @@ -2,17 +2,15 @@ * A class representation of the BSON MinKey type. */ export class MinKey { - /** - * @ignore - */ - toExtendedJSON() { + _bsontype!: 'MinKey'; + + /** @internal */ + toExtendedJSON(): { $minKey: 1 } { return { $minKey: 1 }; } - /** - * @ignore - */ - static fromExtendedJSON() { + /** @internal */ + static fromExtendedJSON(): MinKey { return new MinKey(); } } diff --git a/src/objectid.ts b/src/objectid.ts index e30446bb..51f56848 100644 --- a/src/objectid.ts +++ b/src/objectid.ts @@ -1,39 +1,30 @@ import { Buffer } from 'buffer'; import { deprecate, inspect } from 'util'; -import { randomBytes } from './parser/utils'; +import { haveBuffer, randomBytes } from './parser/utils'; // constants const PROCESS_UNIQUE = randomBytes(5); // Regular expression that checks for hex value const checkForHexRegExp = new RegExp('^[0-9a-fA-F]{24}$'); -let hasBufferType = false; - -// Check if buffer exists -try { - if (Buffer && Buffer.from) hasBufferType = true; -} catch (err) { - hasBufferType = false; -} // Precomputed hex table enables speedy hex string conversion -const hexTable = []; +const hexTable: string[] = []; for (let i = 0; i < 256; i++) { hexTable[i] = (i <= 15 ? '0' : '') + i.toString(16); } // Lookup tables -const decodeLookup = []; +const decodeLookup: number[] = []; let i = 0; while (i < 10) decodeLookup[0x30 + i] = i++; while (i < 16) decodeLookup[0x41 - 10 + i] = decodeLookup[0x61 - 10 + i] = i++; -const _Buffer = Buffer; -function convertToHex(bytes) { +function convertToHex(bytes: Buffer): string { return bytes.toString('hex'); } -function makeObjectIdError(invalidString, index) { +function makeObjectIdError(invalidString: string, index: number) { const invalidCharacter = invalidString[index]; return new TypeError( `ObjectId string "${invalidString}" contains invalid character "${invalidCharacter}" with character code (${invalidString.charCodeAt( @@ -42,10 +33,17 @@ function makeObjectIdError(invalidString, index) { ); } +export interface ObjectIdLike { + id: string | Buffer; + toHexString(): string; +} + /** * A class representation of the BSON ObjectId type. */ export class ObjectId { + _bsontype!: 'ObjectId'; + /** @internal */ static index = ~~(Math.random() * 0xffffff); @@ -56,18 +54,20 @@ export class ObjectId { /** * Create an ObjectId type * - * @param {(string|Buffer|number)} id Can be a 24 byte hex string, 12 byte binary Buffer, or a Number. - * @property {number} generationTime The generation time of this ObjectId instance - * @return {ObjectId} instance of ObjectId. + * @param id - Can be a 24 character hex string, 12 byte binary Buffer, or a number. */ - constructor(id?: string | Buffer | number) { + constructor(id?: string | Buffer | number | ObjectIdLike | ObjectId) { // Duck-typing to support ObjectId from different npm packages - if (id instanceof ObjectId) return id; + if (id instanceof ObjectId) { + this.id = id.id; + this.__id = id.__id; + return; + } // The most common use case (blank id, new objectId instance) if (id == null || typeof id === 'number') { // Generate a new id - this.id = ObjectId.generate(id); + this.id = ObjectId.generate(typeof id === 'number' ? id : undefined); // If we are caching the hex string if (ObjectId.cacheHexString) this.__id = this.toString('hex'); // Return the object @@ -78,20 +78,25 @@ export class ObjectId { const valid = ObjectId.isValid(id); // Throw an error if it's not a valid setup - if (!valid && id != null) { + if (!valid) { throw new TypeError( 'Argument passed in must be a single String of 12 bytes or a string of 24 hex characters' ); - } else if (valid && typeof id === 'string' && id.length === 24 && hasBufferType) { - return new ObjectId(Buffer.from(id, 'hex')); + } else if (valid && typeof id === 'string' && id.length === 24 && haveBuffer()) { + this.id = Buffer.from(id, 'hex'); } else if (valid && typeof id === 'string' && id.length === 24) { - return ObjectId.createFromHexString(id); - } else if (id != null && id.length === 12) { + this.id = ObjectId.createFromHexString(id).id; + // eslint-disable-next-line @typescript-eslint/no-explicit-any + } else if ((id as any)['length'] === 12) { // assume 12 byte string - this.id = id; - } else if (id != null && typeof (id as any).toHexString === 'function') { + this.id = id as string | Buffer; + } else if ( + typeof id !== 'string' && + 'toHexString' in id && + typeof id.toHexString === 'function' + ) { // Duck-typing to support ObjectId from different npm packages - return ObjectId.createFromHexString((id as any).toHexString()); + this.id = ObjectId.createFromHexString(id.toHexString()).id; } else { throw new TypeError( 'Argument passed in must be a single String of 12 bytes or a string of 24 hex characters' @@ -102,12 +107,45 @@ export class ObjectId { } /** - * Return the ObjectId id as a 24 byte hex string representation - * - * @method - * @return {string} return the 24 byte hex string representation. + * The generation time of this ObjectId instance + * @deprecated Please use getTimestamp / createFromTime which returns a Date */ - toHexString() { + get generationTime(): number { + if (typeof this.id === 'string') { + return ( + this.id.charCodeAt(3) | + (this.id.charCodeAt(2) << 8) | + (this.id.charCodeAt(1) << 16) | + (this.id.charCodeAt(0) << 24) + ); + } + return this.id[3] | (this.id[2] << 8) | (this.id[1] << 16) | (this.id[0] << 24); + } + + /** + * Sets the generation time of this ObjectId instance + * @deprecated Please use createFromTime + */ + set generationTime(value: number) { + // Encode time into first 4 bytes + const bytes = [value & 0xff, (value >> 8) & 0xff, (value >> 16) & 0xff, (value >> 24) & 0xff]; + if (typeof this.id === 'string') { + let result = ''; + for (const byte of bytes) { + result += String.fromCharCode(byte); + } + result += this.id.slice(4); + this.id = result; + return; + } + this.id[3] = value & 0xff; + this.id[2] = (value >> 8) & 0xff; + this.id[1] = (value >> 16) & 0xff; + this.id[0] = (value >> 24) & 0xff; + } + + /** Returns the ObjectId id as a 24 character hex string representation */ + toHexString(): string { if (ObjectId.cacheHexString && this.__id) return this.__id; let hexString = ''; @@ -119,7 +157,7 @@ export class ObjectId { ); } - if (this.id instanceof _Buffer) { + if (this.id instanceof Buffer) { hexString = convertToHex(this.id); if (ObjectId.cacheHexString) this.__id = hexString; return hexString; @@ -138,24 +176,21 @@ export class ObjectId { } /** - * Update the ObjectId index used in generating new ObjectId's on the driver - * - * @method - * @return {number} returns next index value. - * @ignore + * Update the ObjectId index + * @privateRemarks + * Used in generating new ObjectId's on the driver + * @internal */ - static getInc() { + static getInc(): number { return (ObjectId.index = (ObjectId.index + 1) % 0xffffff); } /** * Generate a 12 byte id buffer used in ObjectId's * - * @method - * @param {number} [time] optional parameter allowing to pass in a second based timestamp. - * @return {Buffer} return the 12 byte id buffer string. + * @param time - pass in a second based timestamp. */ - static generate(time): Buffer { + static generate(time?: number): Buffer { if ('number' !== typeof time) { time = ~~(Date.now() / 1000); } @@ -185,15 +220,14 @@ export class ObjectId { } /** - * Converts the id into a 24 byte hex string for printing + * Converts the id into a 24 character hex string for printing * - * @param {String} format The Buffer toString format parameter. - * @return {String} return the 24 byte hex string representation. - * @ignore + * @param format - The Buffer toString format parameter. + * @internal */ toString(format?: BufferEncoding): string { // Is the id a buffer then use the buffer toString method to return the format - if (this.id && 'copy' in (this.id as any)) { + if (this.id && typeof this.id !== 'string' && 'copy' in (this.id as Buffer)) { return this.id.toString(typeof format === 'string' ? format : 'hex'); } @@ -201,23 +235,23 @@ export class ObjectId { } /** - * Converts to its JSON representation. - * - * @return {String} return the 24 byte hex string representation. - * @ignore + * Converts to its JSON the 24 character hex string representation. + * @internal */ - toJSON() { + toJSON(): string { return this.toHexString(); } /** * Compares the equality of this ObjectId with `otherID`. * - * @method - * @param {object} otherId ObjectId instance to compare against. - * @return {boolean} the result of comparing two ObjectId's + * @param otherId - ObjectId instance to compare against. */ - equals(otherId) { + equals(otherId: string | ObjectId | ObjectIdLike): boolean { + if (otherId === undefined || otherId === null) { + return false; + } + if (otherId instanceof ObjectId) { return this.toString() === otherId.toString(); } @@ -226,7 +260,7 @@ export class ObjectId { typeof otherId === 'string' && ObjectId.isValid(otherId) && otherId.length === 12 && - this.id instanceof _Buffer + this.id instanceof Buffer ) { return otherId === this.id.toString('binary'); } @@ -239,41 +273,41 @@ export class ObjectId { return otherId === this.id; } - if (otherId != null && (otherId instanceof ObjectId || otherId.toHexString)) { + if ( + typeof otherId === 'object' && + 'toHexString' in otherId && + typeof otherId.toHexString === 'function' + ) { return otherId.toHexString() === this.toHexString(); } return false; } - /** - * Returns the generation date (accurate up to the second) that this ID was generated. - * - * @method - * @return {Date} the generation date - */ - getTimestamp() { + /** Returns the generation date (accurate up to the second) that this ID was generated. */ + getTimestamp(): Date { const timestamp = new Date(); - const time = (this.id as Buffer).readUInt32BE(0); + let time: number; + if (typeof this.id !== 'string') { + time = this.id.readUInt32BE(0); + } else { + time = this.generationTime; + } timestamp.setTime(Math.floor(time) * 1000); return timestamp; } - /** - * @ignore - */ - static createPk() { + /** @internal */ + static createPk(): ObjectId { return new ObjectId(); } /** * Creates an ObjectId from a second based number, with the rest of the ObjectId zeroed out. Used for comparisons or sorting the ObjectId. * - * @method - * @param {number} time an integer number representing a number of seconds. - * @return {ObjectId} return the created ObjectId + * @param time - an integer number representing a number of seconds. */ - static createFromTime(time) { + static createFromTime(time: number): ObjectId { const buffer = Buffer.from([0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0]); // Encode time into first 4 bytes buffer[3] = time & 0xff; @@ -287,29 +321,29 @@ export class ObjectId { /** * Creates an ObjectId from a hex string representation of an ObjectId. * - * @method - * @param {string} hexString create a ObjectId from a passed in 24 byte hexstring. - * @return {ObjectId} return the created ObjectId + * @param hexString - create a ObjectId from a passed in 24 character hexstring. */ - static createFromHexString(string) { + static createFromHexString(hexString: string): ObjectId { // Throw an error if it's not a valid setup - if (typeof string === 'undefined' || (string != null && string.length !== 24)) { + if (typeof hexString === 'undefined' || (hexString != null && hexString.length !== 24)) { throw new TypeError( 'Argument passed in must be a single String of 12 bytes or a string of 24 hex characters' ); } // Use Buffer.from method if available - if (hasBufferType) return new ObjectId(Buffer.from(string, 'hex')); + if (haveBuffer()) { + return new ObjectId(Buffer.from(hexString, 'hex')); + } // Calculate lengths - const array = new _Buffer(12); + const array = Buffer.alloc(12); let n = 0; let i = 0; while (i < 24) { array[n++] = - (decodeLookup[string.charCodeAt(i++)] << 4) | decodeLookup[string.charCodeAt(i++)]; + (decodeLookup[hexString.charCodeAt(i++)] << 4) | decodeLookup[hexString.charCodeAt(i++)]; } return new ObjectId(array); @@ -318,11 +352,9 @@ export class ObjectId { /** * Checks if a value is a valid bson ObjectId * - * @method - * @param {*} id ObjectId instance to validate. - * @return {boolean} return true if the value is a valid bson ObjectId, return false otherwise. + * @param id - ObjectId instance to validate. */ - static isValid(id) { + static isValid(id: number | string | ObjectId | Buffer | ObjectIdLike): boolean { if (id == null) return false; if (typeof id === 'number') { @@ -337,61 +369,37 @@ export class ObjectId { return true; } - if (id instanceof _Buffer && id.length === 12) { + if (id instanceof Buffer && id.length === 12) { return true; } // Duck-Typing detection of ObjectId like objects - if ( - typeof id.toHexString === 'function' && - (id.id instanceof _Buffer || typeof id.id === 'string') - ) { - return id.id.length === 12 || (id.id.length === 24 && checkForHexRegExp.test(id.id)); + if (typeof id === 'object' && 'toHexString' in id && typeof id.toHexString === 'function') { + if (typeof id.id === 'string') { + return id.id.length === 12; + } + return id.toHexString().length === 24 && checkForHexRegExp.test(id.id.toString('hex')); } return false; } - /** - * @ignore - */ - toExtendedJSON() { + /** @internal */ + toExtendedJSON(): { $oid: string } { if (this.toHexString) return { $oid: this.toHexString() }; return { $oid: this.toString('hex') }; } - /** - * @ignore - */ - static fromExtendedJSON(doc) { + /** @internal */ + static fromExtendedJSON(doc: { $oid: string }): ObjectId { return new ObjectId(doc.$oid); } - - // deprecations } // Deprecated methods - -/** - * @ignore - */ -Object.defineProperty(ObjectId.prototype, 'generationTime', { - enumerable: true, - get: function () { - return this.id[3] | (this.id[2] << 8) | (this.id[1] << 16) | (this.id[0] << 24); - }, - set: function (value) { - // Encode time into first 4 bytes - this.id[3] = value & 0xff; - this.id[2] = (value >> 8) & 0xff; - this.id[1] = (value >> 16) & 0xff; - this.id[0] = (value >> 24) & 0xff; - } -}); - Object.defineProperty(ObjectId.prototype, 'generate', { value: deprecate( - time => ObjectId.generate(time), + (time: number) => ObjectId.generate(time), 'Please use the static `ObjectId.generate(time)` instead' ) }); @@ -411,12 +419,9 @@ Object.defineProperty(ObjectId, 'get_inc', { /** * Converts to a string representation of this Id. * - * @return {String} return the 24 byte hex string representation. - * @ignore + * @returns return the 24 character hex string representation. + * @internal */ -ObjectId.prototype[(inspect.custom as any) || 'inspect'] = ObjectId.prototype.toString; +Object.defineProperty(ObjectId.prototype, inspect.custom || 'inspect', ObjectId.prototype.toString); -// In 4.0.0 and 4.0.1, this property name was changed to ObjectId to match the class name. -// This caused interoperability problems with previous versions of the library, so in -// later builds we changed it back to ObjectID (capital D) to match legacy implementations. Object.defineProperty(ObjectId.prototype, '_bsontype', { value: 'ObjectID' }); diff --git a/src/parser/calculate_size.ts b/src/parser/calculate_size.ts index fe5a6c8f..36dc3162 100644 --- a/src/parser/calculate_size.ts +++ b/src/parser/calculate_size.ts @@ -1,14 +1,14 @@ import { Buffer } from 'buffer'; import { Binary } from '../binary'; +import type { Document } from '../bson'; import * as constants from '../constants'; -import { normalizedFunctionString } from './utils'; +import { isDate, normalizedFunctionString } from './utils'; -// To ensure that 0.4 of node works correctly -function isDate(d) { - return typeof d === 'object' && Object.prototype.toString.call(d) === '[object Date]'; -} - -export function calculateObjectSize(object, serializeFunctions, ignoreUndefined) { +export function calculateObjectSize( + object: Document, + serializeFunctions?: boolean, + ignoreUndefined?: boolean +): number { let totalLength = 4 + 1; if (Array.isArray(object)) { @@ -37,11 +37,15 @@ export function calculateObjectSize(object, serializeFunctions, ignoreUndefined) return totalLength; } -/** - * @ignore - * @api private - */ -function calculateElement(name, value, serializeFunctions, isArray, ignoreUndefined) { +/** @internal */ +function calculateElement( + name: string, + // eslint-disable-next-line @typescript-eslint/no-explicit-any + value: any, + serializeFunctions = false, + isArray = false, + ignoreUndefined = false +) { // If we have toBSON defined, override the current object if (value && value.toBSON) { value = value.toBSON(); diff --git a/src/parser/deserializer.ts b/src/parser/deserializer.ts index c97b8a8d..497527b1 100644 --- a/src/parser/deserializer.ts +++ b/src/parser/deserializer.ts @@ -1,8 +1,9 @@ import { Buffer } from 'buffer'; import { Binary } from '../binary'; +import type { Document } from '../bson'; import { Code } from '../code'; import * as constants from '../constants'; -import { DBRef, isDBRefLike } from '../db_ref'; +import { DBRef, DBRefLike, isDBRefLike } from '../db_ref'; import { Decimal128 } from '../decimal128'; import { Double } from '../double'; import { Int32 } from '../int_32'; @@ -15,13 +16,42 @@ import { BSONSymbol } from '../symbol'; import { Timestamp } from '../timestamp'; import { validateUtf8 } from '../validate_utf8'; +export interface DeserializationOptions { + /** evaluate functions in the BSON document scoped to the object deserialized. */ + evalFunctions?: boolean; + /** cache evaluated functions for reuse. */ + cacheFunctions?: boolean; + /** use a crc32 code for caching, otherwise use the string of the function. */ + cacheFunctionsCrc32?: boolean; + /** when deserializing a Long will fit it into a Number if it's smaller than 53 bits */ + promoteLongs?: boolean; + /** when deserializing a Binary will return it as a node.js Buffer instance. */ + promoteBuffers?: boolean; + /** when deserializing will promote BSON values to their Node.js closest equivalent types. */ + promoteValues?: boolean; + /** allow to specify if there what fields we wish to return as unserialized raw buffer. */ + fieldsAsRaw?: Document; + /** return BSON regular expressions as BSONRegExp instances. */ + bsonRegExp?: boolean; + /** allows the buffer to be larger than the parsed BSON object */ + allowObjectSmallerThanBufferSize?: boolean; + /** Offset into buffer to begin reading document from */ + index?: number; + + raw?: boolean; +} + // Internal long versions const JS_INT_MAX_LONG = Long.fromNumber(constants.JS_INT_MAX); const JS_INT_MIN_LONG = Long.fromNumber(constants.JS_INT_MIN); -const functionCache = {}; +const functionCache: { [hash: string]: Function } = {}; -export function deserialize(buffer, options, isArray?: boolean) { +export function deserialize( + buffer: Buffer, + options: DeserializationOptions, + isArray?: boolean +): Document { options = options == null ? {} : options; const index = options && options.index ? options.index : 0; // Read the document size @@ -60,14 +90,23 @@ export function deserialize(buffer, options, isArray?: boolean) { return deserializeObject(buffer, index, options, isArray); } -function deserializeObject(buffer, index, options, isArray) { +function deserializeObject( + buffer: Buffer, + index: number, + options: DeserializationOptions, + isArray = false +) { const evalFunctions = options['evalFunctions'] == null ? false : options['evalFunctions']; const cacheFunctions = options['cacheFunctions'] == null ? false : options['cacheFunctions']; const cacheFunctionsCrc32 = options['cacheFunctionsCrc32'] == null ? false : options['cacheFunctionsCrc32']; let crc32; - if (!cacheFunctionsCrc32) crc32 = null; + if (!cacheFunctionsCrc32) { + crc32 = null; + } else { + crc32 = (v: string) => v; // FIXME(NODE-2770): This is a bug, hashing function is missing. + } const fieldsAsRaw = options['fieldsAsRaw'] == null ? null : options['fieldsAsRaw']; @@ -96,7 +135,7 @@ function deserializeObject(buffer, index, options, isArray) { if (size < 5 || size > buffer.length) throw new Error('corrupt bson message'); // Create holding object - const object = isArray ? [] : {}; + const object: Document = isArray ? [] : {}; // Used for arrays to skip having to perform utf8 decoding let arrayIndex = 0; const done = false; @@ -212,7 +251,11 @@ function deserializeObject(buffer, index, options, isArray) { // All elements of array to be returned as raw bson if (fieldsAsRaw && fieldsAsRaw[name]) { arrayOptions = {}; - for (const n in options) arrayOptions[n] = options[n]; + for (const n in options) { + (arrayOptions as { + [key: string]: DeserializationOptions[keyof DeserializationOptions]; + })[n] = options[n as keyof DeserializationOptions]; + } arrayOptions['raw'] = true; } @@ -255,9 +298,13 @@ function deserializeObject(buffer, index, options, isArray) { // Update index index = index + 16; // Assign the new Decimal128 value - const decimal128 = new Decimal128(bytes); + const decimal128 = new Decimal128(bytes) as Decimal128 | { toObject(): unknown }; // If we have an alternative mapper use that - object[name] = decimal128.toObject ? decimal128.toObject() : decimal128; + if ('toObject' in decimal128 && typeof decimal128.toObject === 'function') { + object[name] = decimal128.toObject(); + } else { + object[name] = decimal128; + } } else if (elementType === constants.BSON_DATA_BINARY) { let binarySize = buffer[index++] | @@ -452,7 +499,7 @@ function deserializeObject(buffer, index, options, isArray) { if (evalFunctions) { // If we have cache enabled let's look for the md5 of the function in the cache if (cacheFunctions) { - const hash = cacheFunctionsCrc32 ? crc32(functionString) : functionString; + const hash = cacheFunctionsCrc32 && crc32 ? crc32(functionString) : functionString; // Got to do this to avoid V8 deoptimizing the call due to finding eval object[name] = isolateEvalWithHash(functionCache, hash, functionString, object); } else { @@ -521,7 +568,7 @@ function deserializeObject(buffer, index, options, isArray) { if (evalFunctions) { // If we have cache enabled let's look for the md5 of the function in the cache if (cacheFunctions) { - const hash = cacheFunctionsCrc32 ? crc32(functionString) : functionString; + const hash = cacheFunctionsCrc32 && crc32 ? crc32(functionString) : functionString; // Got to do this to avoid V8 deoptimizing the call due to finding eval object[name] = isolateEvalWithHash(functionCache, hash, functionString, object); } else { @@ -592,23 +639,27 @@ function deserializeObject(buffer, index, options, isArray) { if (!valid) return object; if (isDBRefLike(object)) { - const copy = Object.assign({}, object); + const copy = Object.assign({}, object) as Partial; delete copy.$ref; delete copy.$id; delete copy.$db; - return new DBRef(object.$ref, object.$id, object.$db || null, copy); + return new DBRef(object.$ref, object.$id, object.$db, copy); } return object; } /** - * Ensure eval is isolated. + * Ensure eval is isolated, store the result in functionCache. * - * @ignore - * @api private + * @internal */ -function isolateEvalWithHash(functionCache, hash, functionString, object) { +function isolateEvalWithHash( + functionCache: { [hash: string]: Function }, + hash: string, + functionString: string, + object: Document +) { // Check for cache hit, eval if missing and return cached function if (functionCache[hash] == null) { functionCache[hash] = new Function(functionString); @@ -621,9 +672,8 @@ function isolateEvalWithHash(functionCache, hash, functionString, object) { /** * Ensure eval is isolated. * - * @ignore - * @api private + * @internal */ -function isolateEval(functionString) { +function isolateEval(functionString: string): Function { return new Function(functionString); } diff --git a/src/parser/serializer.ts b/src/parser/serializer.ts index ddc3c60c..9c7724c7 100644 --- a/src/parser/serializer.ts +++ b/src/parser/serializer.ts @@ -1,35 +1,65 @@ import { Buffer } from 'buffer'; import { Binary } from '../binary'; +import type { BSONSymbol, DBRef, Document, MaxKey } from '../bson'; +import type { Code } from '../code'; import * as constants from '../constants'; +import type { DBRefLike } from '../db_ref'; +import type { Decimal128 } from '../decimal128'; +import type { Double } from '../double'; +import { isBSONType } from '../extended_json'; import { writeIEEE754 } from '../float_parser'; +import type { Int32 } from '../int_32'; import { Long } from '../long'; import { Map } from '../map'; -import { normalizedFunctionString } from './utils'; +import type { MinKey } from '../min_key'; +import type { ObjectId } from '../objectid'; +import type { BSONRegExp } from '../regexp'; +import { isDate, normalizedFunctionString } from './utils'; + +export interface SerializationOptions { + /** the serializer will check if keys are valid. */ + checkKeys?: boolean; + /** serialize the javascript functions **(default:false)**. */ + serializeFunctions?: boolean; + /** serialize will not emit undefined fields **(default:true)** */ + ignoreUndefined?: boolean; + /** @internal Resize internal buffer */ + minInternalBufferSize?: number; + /** the index in the buffer where we wish to start serializing into */ + index?: number; +} const regexp = /\x00/; // eslint-disable-line no-control-regex const ignoreKeys = new Set(['$db', '$ref', '$id', '$clusterTime']); -// To ensure that 0.4 of node works correctly -const isDate = function isDate(d) { - return typeof d === 'object' && Object.prototype.toString.call(d) === '[object Date]'; -}; - -const isRegExp = function isRegExp(d) { +function isRegExp(d: unknown): d is RegExp { return Object.prototype.toString.call(d) === '[object RegExp]'; -}; +} -function serializeString(buffer, key, value, index, isArray?: boolean) { +/* + * isArray indicates if we are writing to a BSON array (type 0x04) + * which forces the "key" which really an array index as a string to be written as ascii + * This will catch any errors in index as a string generation + */ + +function serializeString( + buffer: Buffer, + key: string, + value: string, + index: number, + isArray?: boolean +) { // Encode String type buffer[index++] = constants.BSON_DATA_STRING; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes + 1; buffer[index - 1] = 0; // Write the string - const size = buffer.write(value, index + 4, 'utf8'); + const size = buffer.write(value, index + 4, undefined, 'utf8'); // Write the size of the string to buffer buffer[index + 3] = ((size + 1) >> 24) & 0xff; buffer[index + 2] = ((size + 1) >> 16) & 0xff; @@ -42,8 +72,16 @@ function serializeString(buffer, key, value, index, isArray?: boolean) { return index; } -function serializeNumber(buffer, key, value, index, isArray?: boolean) { +function serializeNumber( + buffer: Buffer, + key: string, + value: number, + index: number, + isArray?: boolean +) { // We have an integer value + // TODO(NODE-2769): Issue serializing large integers as doubles + // TODO(NODE-2529): Add support for big int if ( Math.floor(value) === value && value >= constants.JS_INT_MIN && @@ -56,8 +94,8 @@ function serializeNumber(buffer, key, value, index, isArray?: boolean) { buffer[index++] = constants.BSON_DATA_INT; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; @@ -71,22 +109,22 @@ function serializeNumber(buffer, key, value, index, isArray?: boolean) { buffer[index++] = constants.BSON_DATA_NUMBER; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; // Write float writeIEEE754(buffer, value, index, 'little', 52, 8); - // Ajust index + // Adjust index index = index + 8; } else { // Set long type buffer[index++] = constants.BSON_DATA_LONG; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; @@ -109,28 +147,28 @@ function serializeNumber(buffer, key, value, index, isArray?: boolean) { buffer[index++] = constants.BSON_DATA_NUMBER; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; // Write float writeIEEE754(buffer, value, index, 'little', 52, 8); - // Ajust index + // Adjust index index = index + 8; } return index; } -function serializeNull(buffer, key, value, index, isArray?: boolean) { +function serializeNull(buffer: Buffer, key: string, _: unknown, index: number, isArray?: boolean) { // Set long type buffer[index++] = constants.BSON_DATA_NULL; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; @@ -138,13 +176,19 @@ function serializeNull(buffer, key, value, index, isArray?: boolean) { return index; } -function serializeBoolean(buffer, key, value, index, isArray?: boolean) { +function serializeBoolean( + buffer: Buffer, + key: string, + value: boolean, + index: number, + isArray?: boolean +) { // Write the type buffer[index++] = constants.BSON_DATA_BOOLEAN; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; @@ -153,13 +197,13 @@ function serializeBoolean(buffer, key, value, index, isArray?: boolean) { return index; } -function serializeDate(buffer, key, value, index, isArray?: boolean) { +function serializeDate(buffer: Buffer, key: string, value: Date, index: number, isArray?: boolean) { // Write the type buffer[index++] = constants.BSON_DATA_DATE; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; @@ -181,13 +225,19 @@ function serializeDate(buffer, key, value, index, isArray?: boolean) { return index; } -function serializeRegExp(buffer, key, value, index, isArray?: boolean) { +function serializeRegExp( + buffer: Buffer, + key: string, + value: RegExp, + index: number, + isArray?: boolean +) { // Write the type buffer[index++] = constants.BSON_DATA_REGEXP; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; @@ -196,7 +246,7 @@ function serializeRegExp(buffer, key, value, index, isArray?: boolean) { throw Error('value ' + value.source + ' must not contain null bytes'); } // Adjust the index - index = index + buffer.write(value.source, index, 'utf8'); + index = index + buffer.write(value.source, index, undefined, 'utf8'); // Write zero buffer[index++] = 0x00; // Write the parameters @@ -209,13 +259,19 @@ function serializeRegExp(buffer, key, value, index, isArray?: boolean) { return index; } -function serializeBSONRegExp(buffer, key, value, index, isArray?: boolean) { +function serializeBSONRegExp( + buffer: Buffer, + key: string, + value: BSONRegExp, + index: number, + isArray?: boolean +) { // Write the type buffer[index++] = constants.BSON_DATA_REGEXP; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; @@ -228,17 +284,23 @@ function serializeBSONRegExp(buffer, key, value, index, isArray?: boolean) { } // Adjust the index - index = index + buffer.write(value.pattern, index, 'utf8'); + index = index + buffer.write(value.pattern, index, undefined, 'utf8'); // Write zero buffer[index++] = 0x00; // Write the options - index = index + buffer.write(value.options.split('').sort().join(''), index, 'utf8'); + index = index + buffer.write(value.options.split('').sort().join(''), index, undefined, 'utf8'); // Add ending zero buffer[index++] = 0x00; return index; } -function serializeMinMax(buffer, key, value, index, isArray?: boolean) { +function serializeMinMax( + buffer: Buffer, + key: string, + value: MinKey | MaxKey, + index: number, + isArray?: boolean +) { // Write the type of either min or max key if (value === null) { buffer[index++] = constants.BSON_DATA_NULL; @@ -250,21 +312,27 @@ function serializeMinMax(buffer, key, value, index, isArray?: boolean) { // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; return index; } -function serializeObjectId(buffer, key, value, index, isArray?: boolean) { +function serializeObjectId( + buffer: Buffer, + key: string, + value: ObjectId, + index: number, + isArray?: boolean +) { // Write the type buffer[index++] = constants.BSON_DATA_OID; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; @@ -272,24 +340,30 @@ function serializeObjectId(buffer, key, value, index, isArray?: boolean) { // Write the objectId into the shared buffer if (typeof value.id === 'string') { - buffer.write(value.id, index, 'binary'); + buffer.write(value.id, index, undefined, 'binary'); } else if (value.id && value.id.copy) { value.id.copy(buffer, index, 0, 12); } else { throw new TypeError('object [' + JSON.stringify(value) + '] is not a valid ObjectId'); } - // Ajust index + // Adjust index return index + 12; } -function serializeBuffer(buffer, key, value, index, isArray?: boolean) { +function serializeBuffer( + buffer: Buffer, + key: string, + value: Buffer, + index: number, + isArray?: boolean +) { // Write the type buffer[index++] = constants.BSON_DATA_BINARY; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; @@ -310,16 +384,16 @@ function serializeBuffer(buffer, key, value, index, isArray?: boolean) { } function serializeObject( - buffer, - key, - value, - index, - checkKeys, - depth, - serializeFunctions, - ignoreUndefined, - isArray, - path + buffer: Buffer, + key: string, + value: Document, + index: number, + checkKeys = false, + depth = 0, + serializeFunctions = false, + ignoreUndefined = true, + isArray = false, + path: Document[] = [] ) { for (let i = 0; i < path.length; i++) { if (path[i] === value) throw new Error('cyclic dependency detected'); @@ -331,8 +405,8 @@ function serializeObject( buffer[index++] = Array.isArray(value) ? constants.BSON_DATA_ARRAY : constants.BSON_DATA_OBJECT; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; @@ -351,12 +425,18 @@ function serializeObject( return endIndex; } -function serializeDecimal128(buffer, key, value, index, isArray?: boolean) { +function serializeDecimal128( + buffer: Buffer, + key: string, + value: Decimal128, + index: number, + isArray?: boolean +) { buffer[index++] = constants.BSON_DATA_DECIMAL128; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; @@ -365,14 +445,14 @@ function serializeDecimal128(buffer, key, value, index, isArray?: boolean) { return index + 16; } -function serializeLong(buffer, key, value, index, isArray?: boolean) { +function serializeLong(buffer: Buffer, key: string, value: Long, index: number, isArray?: boolean) { // Write the type buffer[index++] = value._bsontype === 'Long' ? constants.BSON_DATA_LONG : constants.BSON_DATA_TIMESTAMP; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; @@ -392,13 +472,20 @@ function serializeLong(buffer, key, value, index, isArray?: boolean) { return index; } -function serializeInt32(buffer, key, value, index, isArray?: boolean) { +function serializeInt32( + buffer: Buffer, + key: string, + value: Int32 | number, + index: number, + isArray?: boolean +) { + value = value.valueOf(); // Set int type 32 bits or less buffer[index++] = constants.BSON_DATA_INT; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; @@ -410,14 +497,20 @@ function serializeInt32(buffer, key, value, index, isArray?: boolean) { return index; } -function serializeDouble(buffer, key, value, index, isArray?: boolean) { +function serializeDouble( + buffer: Buffer, + key: string, + value: Double, + index: number, + isArray?: boolean +) { // Encode as double buffer[index++] = constants.BSON_DATA_NUMBER; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; @@ -431,12 +524,20 @@ function serializeDouble(buffer, key, value, index, isArray?: boolean) { return index; } -function serializeFunction(buffer, key, value, index, checkKeys, depth, isArray?: boolean) { +function serializeFunction( + buffer: Buffer, + key: string, + value: Function, + index: number, + _checkKeys = false, + _depth = 0, + isArray?: boolean +) { buffer[index++] = constants.BSON_DATA_CODE; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; @@ -444,7 +545,7 @@ function serializeFunction(buffer, key, value, index, checkKeys, depth, isArray? const functionString = normalizedFunctionString(value); // Write the string - const size = buffer.write(functionString, index + 4, 'utf8') + 1; + const size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; // Write the size of the string to buffer buffer[index] = size & 0xff; buffer[index + 1] = (size >> 8) & 0xff; @@ -458,23 +559,23 @@ function serializeFunction(buffer, key, value, index, checkKeys, depth, isArray? } function serializeCode( - buffer, - key, - value, - index, - checkKeys, - depth, - serializeFunctions, - ignoreUndefined, - isArray?: boolean + buffer: Buffer, + key: string, + value: Code, + index: number, + checkKeys = false, + depth = 0, + serializeFunctions = false, + ignoreUndefined = true, + isArray = false ) { if (value.scope && typeof value.scope === 'object') { // Write the type buffer[index++] = constants.BSON_DATA_CODE_W_SCOPE; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; @@ -488,7 +589,7 @@ function serializeCode( // Index adjustment index = index + 4; // Write string into buffer - const codeSize = buffer.write(functionString, index + 4, 'utf8') + 1; + const codeSize = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; // Write the size of the string to buffer buffer[index] = codeSize & 0xff; buffer[index + 1] = (codeSize >> 8) & 0xff; @@ -526,15 +627,15 @@ function serializeCode( buffer[index++] = constants.BSON_DATA_CODE; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; // Function string const functionString = value.code.toString(); // Write the string - const size = buffer.write(functionString, index + 4, 'utf8') + 1; + const size = buffer.write(functionString, index + 4, undefined, 'utf8') + 1; // Write the size of the string to buffer buffer[index] = size & 0xff; buffer[index + 1] = (size >> 8) & 0xff; @@ -549,18 +650,24 @@ function serializeCode( return index; } -function serializeBinary(buffer, key, value, index, isArray?: boolean) { +function serializeBinary( + buffer: Buffer, + key: string, + value: Binary, + index: number, + isArray?: boolean +) { // Write the type buffer[index++] = constants.BSON_DATA_BINARY; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; // Extract the buffer - const data = value.value(true); + const data = value.value(true) as Buffer | Uint8Array; // Calculate size let size = value.position; // Add the deprecated 02 type 4 bytes of size to total @@ -583,24 +690,30 @@ function serializeBinary(buffer, key, value, index, isArray?: boolean) { } // Write the data to the object - data.copy(buffer, index, 0, value.position); + buffer.set(data, index); // Adjust the index index = index + value.position; return index; } -function serializeSymbol(buffer, key, value, index, isArray?: boolean) { +function serializeSymbol( + buffer: Buffer, + key: string, + value: BSONSymbol, + index: number, + isArray?: boolean +) { // Write the type buffer[index++] = constants.BSON_DATA_SYMBOL; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; // Write the string - const size = buffer.write(value.value, index + 4, 'utf8') + 1; + const size = buffer.write(value.value, index + 4, undefined, 'utf8') + 1; // Write the size of the string to buffer buffer[index] = size & 0xff; buffer[index + 1] = (size >> 8) & 0xff; @@ -613,25 +726,35 @@ function serializeSymbol(buffer, key, value, index, isArray?: boolean) { return index; } -function serializeDBRef(buffer, key, value, index, depth, serializeFunctions, isArray?: boolean) { +function serializeDBRef( + buffer: Buffer, + key: string, + value: DBRef, + index: number, + depth: number, + serializeFunctions: boolean, + isArray?: boolean +) { // Write the type buffer[index++] = constants.BSON_DATA_OBJECT; // Number of written bytes const numberOfWrittenBytes = !isArray - ? buffer.write(key, index, 'utf8') - : buffer.write(key, index, 'ascii'); + ? buffer.write(key, index, undefined, 'utf8') + : buffer.write(key, index, undefined, 'ascii'); // Encode the name index = index + numberOfWrittenBytes; buffer[index++] = 0; let startIndex = index; - let output = { + let output: DBRefLike = { $ref: value.collection || value.namespace, // "namespace" was what library 1.x called "collection" $id: value.oid }; - if (value.db != null) (output as any).$db = value.db; + if (value.db != null) { + output.$db = value.db; + } output = Object.assign(output, value.fields); const endIndex = serializeInto(buffer, output, false, index, depth + 1, serializeFunctions); @@ -648,15 +771,15 @@ function serializeDBRef(buffer, key, value, index, depth, serializeFunctions, is } export function serializeInto( - buffer, - object, - checkKeys, - startingIndex, - depth, - serializeFunctions?: boolean, - ignoreUndefined?: boolean, - path?: any[] -) { + buffer: Buffer, + object: Document, + checkKeys = false, + startingIndex = 0, + depth = 0, + serializeFunctions = false, + ignoreUndefined = true, + path: Document[] = [] +): number { startingIndex = startingIndex || 0; path = path || []; @@ -679,12 +802,11 @@ export function serializeInto( value = value.toBSON(); } - const type = typeof value; - if (type === 'string') { + if (typeof value === 'string') { index = serializeString(buffer, key, value, index, true); - } else if (type === 'number') { + } else if (typeof value === 'number') { index = serializeNumber(buffer, key, value, index, true); - } else if (type === 'boolean') { + } else if (typeof value === 'boolean') { index = serializeBoolean(buffer, key, value, index, true); } else if (value instanceof Date || isDate(value)) { index = serializeDate(buffer, key, value, index, true); @@ -698,7 +820,7 @@ export function serializeInto( index = serializeBuffer(buffer, key, value, index, true); } else if (value instanceof RegExp || isRegExp(value)) { index = serializeRegExp(buffer, key, value, index, true); - } else if (type === 'object' && value['_bsontype'] == null) { + } else if (typeof value === 'object' && value['_bsontype'] == null) { index = serializeObject( buffer, key, @@ -711,7 +833,11 @@ export function serializeInto( true, path ); - } else if (type === 'object' && value['_bsontype'] === 'Decimal128') { + } else if ( + typeof value === 'object' && + isBSONType(value) && + value._bsontype === 'Decimal128' + ) { index = serializeDecimal128(buffer, key, value, index, true); } else if (value['_bsontype'] === 'Long' || value['_bsontype'] === 'Timestamp') { index = serializeLong(buffer, key, value, index, true); @@ -754,7 +880,7 @@ export function serializeInto( while (!done) { // Unpack the next entry const entry = iterator.next(); - done = entry.done; + done = !!entry.done; // Are we done, then skip and terminate if (done) continue; diff --git a/src/parser/utils.ts b/src/parser/utils.ts index bbbea23a..34bf8e8f 100644 --- a/src/parser/utils.ts +++ b/src/parser/utils.ts @@ -1,19 +1,19 @@ -/* global window */ - /** * Normalizes our expected stringified form of a function across versions of node - * @param {Function} fn The function to stringify + * @param fn - The function to stringify */ export function normalizedFunctionString(fn: Function): string { return fn.toString().replace('function(', 'function ('); } -function insecureRandomBytes(size) { +function insecureRandomBytes(size: number): Uint8Array { const result = new Uint8Array(size); for (let i = 0; i < size; ++i) result[i] = Math.floor(Math.random() * 256); return result; } +/* We do not want to have to include DOM types just for this check */ +// eslint-disable-next-line @typescript-eslint/no-explicit-any declare let window: any; export let randomBytes = insecureRandomBytes; @@ -21,6 +21,7 @@ if (typeof window !== 'undefined' && window.crypto && window.crypto.getRandomVal randomBytes = size => window.crypto.getRandomValues(new Uint8Array(size)); } else { try { + // eslint-disable-next-line @typescript-eslint/no-var-requires randomBytes = require('crypto').randomBytes; } catch (e) { // keep the fallback @@ -31,3 +32,31 @@ if (typeof window !== 'undefined' && window.crypto && window.crypto.getRandomVal randomBytes = insecureRandomBytes; } } + +export function isUint8Array(value: unknown): value is Uint8Array { + return Object.prototype.toString.call(value) === '[object Uint8Array]'; +} + +/** Call to check if your environment has `Buffer` */ +export function haveBuffer(): boolean { + return typeof global !== 'undefined' && typeof global.Buffer !== 'undefined'; +} + +/** Callable in any environment to check if value is a Buffer */ +export function isBuffer(value: unknown): value is Buffer { + return haveBuffer() && Buffer.isBuffer(value); +} + +// To ensure that 0.4 of node works correctly +export function isDate(d: unknown): d is Date { + return isObjectLike(d) && Object.prototype.toString.call(d) === '[object Date]'; +} + +/** + * @internal + * this is to solve the `'someKey' in x` problem where x is unknown. + * https://github.com/typescript-eslint/typescript-eslint/issues/1071#issuecomment-541955753 + */ +export function isObjectLike(candidate: unknown): candidate is Record { + return typeof candidate === 'object' && candidate !== null; +} diff --git a/src/regexp.ts b/src/regexp.ts index 9eecc19c..a654d14c 100644 --- a/src/regexp.ts +++ b/src/regexp.ts @@ -1,18 +1,26 @@ -function alphabetize(str) { +import type { EJSONOptions } from './extended_json'; + +function alphabetize(str: string): string { return str.split('').sort().join(''); } -/** - * A class representation of the BSON RegExp type. - */ +export type BSONRegExpEJSON = + | { $regex: string | BSONRegExp; $options: string } + | { $regularExpression: { pattern: string; options: string } }; + +/** A class representation of the BSON RegExp type. */ export class BSONRegExp { + _bsontype!: 'BSONRegExp'; + + pattern: string; + options: string; /** - * Create a RegExp type - * - * @param {string} pattern The regular expression pattern to match - * @param {string} options The regular expression options + * @param pattern - The regular expression pattern to match + * @param options - The regular expression options */ - constructor(public pattern = '', public options = '') { + constructor(pattern: string, options?: string) { + this.pattern = pattern; + this.options = options ?? ''; // Execute alphabetize(this.options); @@ -33,14 +41,12 @@ export class BSONRegExp { } } - static parseOptions(options) { + static parseOptions(options?: string): string { return options ? options.split('').sort().join('') : ''; } - /** - * @ignore - */ - toExtendedJSON(options) { + /** @internal */ + toExtendedJSON(options?: EJSONOptions): BSONRegExpEJSON { options = options || {}; if (options.legacy) { return { $regex: this.pattern, $options: this.options }; @@ -48,21 +54,25 @@ export class BSONRegExp { return { $regularExpression: { pattern: this.pattern, options: this.options } }; } - /** - * @ignore - */ - static fromExtendedJSON(doc) { - if (doc.$regex) { - // This is for $regex query operators that have extended json values. - if (doc.$regex._bsontype === 'BSONRegExp') { - return doc; + /** @internal */ + static fromExtendedJSON(doc: BSONRegExpEJSON): BSONRegExp { + if ('$regex' in doc) { + if (typeof doc.$regex !== 'string') { + // This is for $regex query operators that have extended json values. + if (doc.$regex._bsontype === 'BSONRegExp') { + return (doc as unknown) as BSONRegExp; + } + } else { + return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); } - return new BSONRegExp(doc.$regex, BSONRegExp.parseOptions(doc.$options)); } - return new BSONRegExp( - doc.$regularExpression.pattern, - BSONRegExp.parseOptions(doc.$regularExpression.options) - ); + if ('$regularExpression' in doc) { + return new BSONRegExp( + doc.$regularExpression.pattern, + BSONRegExp.parseOptions(doc.$regularExpression.options) + ); + } + throw new TypeError(`Unexpected BSONRegExp EJSON object form: ${JSON.stringify(doc)}`); } } diff --git a/src/symbol.ts b/src/symbol.ts index d6cbd189..3ce4819d 100644 --- a/src/symbol.ts +++ b/src/symbol.ts @@ -1,59 +1,42 @@ -/** - * A class representation of the BSON Symbol type. - */ +/** A class representation of the BSON Symbol type. */ export class BSONSymbol { - public value: string; + _bsontype!: 'Symbol'; + + value: string; /** - * Create a Symbol type - * - * @param {string} value the string representing the symbol. + * @param value - the string representing the symbol. */ constructor(value: string) { this.value = value; } - /** - * Access the wrapped string value. - * - * @method - * @return {String} returns the wrapped string. - */ - valueOf() { + /** Access the wrapped string value. */ + valueOf(): string { return this.value; } - /** - * @ignore - */ - toString() { + /** @internal */ + toString(): string { return this.value; } - /** - * @ignore - */ - inspect() { + /** @internal */ + inspect(): string { return this.value; } - /** - * @ignore - */ - toJSON() { + /** @internal */ + toJSON(): string { return this.value; } - /** - * @ignore - */ - toExtendedJSON() { + /** @internal */ + toExtendedJSON(): { $symbol: string } { return { $symbol: this.value }; } - /** - * @ignore - */ - static fromExtendedJSON(doc) { + /** @internal */ + static fromExtendedJSON(doc: { $symbol: string }): BSONSymbol { return new BSONSymbol(doc.$symbol); } } diff --git a/src/timestamp.ts b/src/timestamp.ts index 208d3c92..47de48bf 100644 --- a/src/timestamp.ts +++ b/src/timestamp.ts @@ -1,15 +1,24 @@ import { Long } from './long'; -/** - * @class - * @param {number} low the low (signed) 32 bits of the Timestamp. - * @param {number} high the high (signed) 32 bits of the Timestamp. - * @return {Timestamp} - */ -export class Timestamp extends Long { - _bsontype: string; +type TimestampOverrides = '_bsontype' | 'toExtendedJSON' | 'fromExtendedJSON'; +type LongWithoutOverrides = new (low: number | Long, high?: number, unsigned?: boolean) => { + [P in Exclude]: Long[P]; +}; +const LongWithoutOverridesClass: LongWithoutOverrides = (Long as unknown) as LongWithoutOverrides; +export class Timestamp extends LongWithoutOverridesClass { + _bsontype!: 'Timestamp'; + + static readonly MAX_VALUE = Long.MAX_UNSIGNED_VALUE; + + /** + * @param low - A 64-bit Long representing the Timestamp. + */ constructor(low: Long); + /** + * @param low - the low (signed) 32 bits of the Timestamp. + * @param high - the high (signed) 32 bits of the Timestamp. + */ constructor(low: number, high: number); constructor(low: number | Long, high?: number) { if (Long.isLong(low)) { @@ -25,77 +34,49 @@ export class Timestamp extends Long { }); } - /** - * Return the JSON value. - * - * @method - * @return {String} the JSON representation. - */ - toJSON() { + toJSON(): { $timestamp: string } { return { $timestamp: this.toString() }; } - /** - * Returns a Timestamp represented by the given (32-bit) integer value. - * - * @method - * @param {number} value the 32-bit integer in question. - * @return {Timestamp} the timestamp. - */ - static fromInt(value) { + /** Returns a Timestamp represented by the given (32-bit) integer value. */ + static fromInt(value: number): Timestamp { return new Timestamp(Long.fromInt(value, true)); } - /** - * Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. - * - * @method - * @param {number} value the number in question. - * @return {Timestamp} the timestamp. - */ - static fromNumber(value) { + /** Returns a Timestamp representing the given number value, provided that it is a finite number. Otherwise, zero is returned. */ + static fromNumber(value: number): Timestamp { return new Timestamp(Long.fromNumber(value, true)); } /** * Returns a Timestamp for the given high and low bits. Each is assumed to use 32 bits. * - * @method - * @param {number} lowBits the low 32-bits. - * @param {number} highBits the high 32-bits. - * @return {Timestamp} the timestamp. + * @param lowBits - the low 32-bits. + * @param highBits - the high 32-bits. */ - static fromBits(lowBits, highBits) { + static fromBits(lowBits: number, highBits: number): Timestamp { return new Timestamp(lowBits, highBits); } /** * Returns a Timestamp from the given string, optionally using the given radix. * - * @method - * @param {String} str the textual representation of the Timestamp. - * @param {number} [opt_radix] the radix in which the text is written. - * @return {Timestamp} the timestamp. + * @param str - the textual representation of the Timestamp. + * @param optRadix - the radix in which the text is written. */ - static fromString(str, opt_radix) { - return new Timestamp(Long.fromString(str, true, opt_radix)); + static fromString(str: string, optRadix: number): Timestamp { + return new Timestamp(Long.fromString(str, true, optRadix)); } - /** - * @ignore - */ - toExtendedJSON(options): any { + /** @internal */ + toExtendedJSON(): { $timestamp: { t: number; i: number } } { return { $timestamp: { t: this.high >>> 0, i: this.low >>> 0 } }; } - /** - * @ignore - */ - static fromExtendedJSON(doc) { + /** @internal */ + static fromExtendedJSON(doc: { $timestamp: { t: number; i: number } }): Timestamp { return new Timestamp(doc.$timestamp.i, doc.$timestamp.t); } } - -Timestamp.MAX_VALUE = Timestamp.MAX_UNSIGNED_VALUE; diff --git a/src/validate_utf8.ts b/src/validate_utf8.ts index 27799196..e1da934c 100644 --- a/src/validate_utf8.ts +++ b/src/validate_utf8.ts @@ -11,12 +11,15 @@ const CONTINUING_CHAR = 0x80; /** * Determines if the passed in bytes are valid utf8 - * @param {Buffer|Uint8Array} bytes An array of 8-bit bytes. Must be indexable and have length property - * @param {Number} start The index to start validating - * @param {Number} end The index to end validating - * @returns {boolean} True if valid utf8 + * @param bytes - An array of 8-bit bytes. Must be indexable and have length property + * @param start - The index to start validating + * @param end - The index to end validating */ -export function validateUtf8(bytes, start, end) { +export function validateUtf8( + bytes: { [index: number]: number }, + start: number, + end: number +): boolean { let continuation = 0; for (let i = start; i < end; i += 1) { diff --git a/test/node/bson_test.js b/test/node/bson_test.js index 31aff791..e4938580 100644 --- a/test/node/bson_test.js +++ b/test/node/bson_test.js @@ -1053,7 +1053,7 @@ describe('BSON', function () { */ it('Should Correctly Serialize and Deserialize DBRef', function (done) { var oid = new ObjectId(); - var doc = { dbref: new DBRef('namespace', oid, null, {}) }; + var doc = { dbref: new DBRef('namespace', oid, undefined, {}) }; var b = BSON; var serialized_data = b.serialize(doc); diff --git a/test/node/check_constants.js b/test/node/check_constants.js new file mode 100644 index 00000000..f223e9c1 --- /dev/null +++ b/test/node/check_constants.js @@ -0,0 +1,132 @@ +'use strict'; + +const BSON = require('../register-bson'); + +describe('BSON Constants', () => { + context('Binary Subtype', () => { + /* + subtype ::= + | "\x00" Generic binary subtype + | "\x01" Function + | "\x02" Binary (Old) + | "\x03" UUID (Old) + | "\x04" UUID + | "\x05" MD5 + | "\x06" Encrypted BSON value + | "\x80" User defined + */ + it('Default should be 0', () => { + expect(BSON.BSON_BINARY_SUBTYPE_DEFAULT).to.equal(0); + expect(BSON.Binary.SUBTYPE_DEFAULT).to.equal(0); + }); + it('Function should be 1', () => { + expect(BSON.BSON_BINARY_SUBTYPE_FUNCTION).to.equal(1); + expect(BSON.Binary.SUBTYPE_FUNCTION).to.equal(1); + }); + it('Binary (Old) should be 2', () => { + expect(BSON.BSON_BINARY_SUBTYPE_BYTE_ARRAY).to.equal(2); + expect(BSON.Binary.SUBTYPE_BYTE_ARRAY).to.equal(2); + }); + it('UUID (Old) should be 3', () => { + expect(BSON.BSON_BINARY_SUBTYPE_UUID).to.equal(3); + expect(BSON.Binary.SUBTYPE_UUID_OLD).to.equal(3); + }); + it('UUID should be 4', () => { + expect(BSON.BSON_BINARY_SUBTYPE_UUID_NEW).to.equal(4); + expect(BSON.Binary.SUBTYPE_UUID).to.equal(4); + }); + it('MD5 should be 5', () => { + expect(BSON.BSON_BINARY_SUBTYPE_MD5).to.equal(5); + expect(BSON.Binary.SUBTYPE_MD5).to.equal(5); + }); + }); + context('BSON Type indicators', () => { + /* + | "\x01" 64-bit binary floating point + | "\x02" UTF-8 string + | "\x03" Embedded document + | "\x04" Array + | "\x05" Binary data + | "\x06" Undefined (value) — Deprecated + | "\x07" ObjectId + | "\x08" Boolean + | "\x09" UTC date time + | "\x0A" Null value + | "\x0B" Regular expression + | "\x0C" DBPointer — Deprecated + | "\x0D" JavaScript code + | "\x0E" Symbol. — Deprecated + | "\x0F" JavaScript code w/ scope — Deprecated + | "\x10" 32-bit integer + | "\x11" Timestamp + | "\x12" 64-bit integer + | "\x13" 128-bit decimal floating point + | "\xFF" Min key + | "\x7F" Max key + */ + + it('64-bit binary floating point should be 0x01', () => { + expect(BSON.BSON_DATA_NUMBER).to.equal(0x01); + }); + it('UTF-8 string should be 0x02', () => { + expect(BSON.BSON_DATA_STRING).to.equal(0x02); + }); + it('Embedded document should be 0x03', () => { + expect(BSON.BSON_DATA_OBJECT).to.equal(0x03); + }); + it('Array should be 0x04', () => { + expect(BSON.BSON_DATA_ARRAY).to.equal(0x04); + }); + it('Binary data should be 0x05', () => { + expect(BSON.BSON_DATA_BINARY).to.equal(0x05); + }); + it('Undefined (value) — Deprecated should be 0x06', () => { + expect(BSON.BSON_DATA_UNDEFINED).to.equal(0x06); + }); + it('ObjectId should be 0x07', () => { + expect(BSON.BSON_DATA_OID).to.equal(0x07); + }); + it('Boolean should be 0x08', () => { + expect(BSON.BSON_DATA_BOOLEAN).to.equal(0x08); + }); + it('UTC date time should be 0x09', () => { + expect(BSON.BSON_DATA_DATE).to.equal(0x09); + }); + it('Null value should be 0x0A', () => { + expect(BSON.BSON_DATA_NULL).to.equal(0x0a); + }); + it('Regular expression should be 0x0B', () => { + expect(BSON.BSON_DATA_REGEXP).to.equal(0x0b); + }); + it('DBPointer — Deprecated should be 0x0C', () => { + expect(BSON.BSON_DATA_DBPOINTER).to.equal(0x0c); + }); + it('JavaScript code should be 0x0D', () => { + expect(BSON.BSON_DATA_CODE).to.equal(0x0d); + }); + it('Symbol. — Deprecated should be 0x0E', () => { + expect(BSON.BSON_DATA_SYMBOL).to.equal(0x0e); + }); + it('JavaScript code w/ scope — Deprecated should be 0x0F', () => { + expect(BSON.BSON_DATA_CODE_W_SCOPE).to.equal(0x0f); + }); + it('32-bit integer should be 0x10', () => { + expect(BSON.BSON_DATA_INT).to.equal(0x10); + }); + it('Timestamp should be 0x11', () => { + expect(BSON.BSON_DATA_TIMESTAMP).to.equal(0x11); + }); + it('64-bit integer should be 0x12', () => { + expect(BSON.BSON_DATA_LONG).to.equal(0x12); + }); + it('128-bit decimal floating point should be 0x13', () => { + expect(BSON.BSON_DATA_DECIMAL128).to.equal(0x13); + }); + it('Min key should be 0xFF', () => { + expect(BSON.BSON_DATA_MIN_KEY).to.equal(0xff); + }); + it('Max key should be 0x7F', () => { + expect(BSON.BSON_DATA_MAX_KEY).to.equal(0x7f); + }); + }); +}); diff --git a/tsconfig.json b/tsconfig.json index 94d0e526..ce85d471 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -2,14 +2,13 @@ "compilerOptions": { "allowJs": false, "checkJs": false, - "strict": false, + "strict": true, "alwaysStrict": true, "target": "ES2017", "module": "commonjs", "moduleResolution": "node", "lib": [ - "ES2017", - "DOM" // This is included to get the global WebAssembly type in long.ts (it is present in node too) + "ES2017" ], "outDir": "lib", // We don't make use of tslib helpers