From 21433154abf29a505a0cc10b5ba1167a65fb2856 Mon Sep 17 00:00:00 2001 From: Jim Geurts Date: Mon, 27 Dec 2021 16:33:18 -0600 Subject: [PATCH] Release 9.2.2 - Fix to always include populate column names in select query - Use readonly arrays where possible when building sql - Update npms --- CHANGELOG.md | 6 + package-lock.json | 496 ++++++++++++------------------ package.json | 34 +- src/ReadonlyRepository.ts | 36 ++- src/SqlHelper.ts | 35 ++- src/types/GetValueType.ts | 2 +- tests/readonlyRepository.tests.ts | 70 ++++- 7 files changed, 338 insertions(+), 341 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e79fee..50bc9f9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Change Log +## 9.2.2 - 2021-12-27 + +- Fix to always include populate column names in select query +- Use readonly arrays where possible when building sql +- Update npms + ## 9.2.1 - 2021-11-16 - Update npms diff --git a/package-lock.json b/package-lock.json index d9051f6..2199c7d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,54 +1,9 @@ { "name": "bigal", - "version": "9.2.1", + "version": "9.2.2", "lockfileVersion": 1, "requires": true, "dependencies": { - "@babel/code-frame": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.16.0.tgz", - "integrity": "sha512-IF4EOMEV+bfYwOmNxGzSnjR2EmQod7f1UXOpZM3l4i4o4QNwzjtJAu/HxdjHq0aYBvdqMuQEY1eg0nqW9ZPORA==", - "dev": true, - "requires": { - "@babel/highlight": "^7.16.0" - } - }, - "@babel/helper-validator-identifier": { - "version": "7.15.7", - "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.15.7.tgz", - "integrity": "sha512-K4JvCtQqad9OY2+yTU8w+E82ywk/fe+ELNlt1G8z3bVGlZfn/hOcQQsUhGhW/N+tb3fxK800wLtKOE/aM0m72w==", - "dev": true - }, - "@babel/highlight": { - "version": "7.16.0", - "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.16.0.tgz", - "integrity": "sha512-t8MH41kUQylBtu2+4IQA3atqevA2lRgqA2wyVB/YiWmsDSuylZZuXOUy9ric30hfzauEFfdsuk/eXTRrGrfd0g==", - "dev": true, - "requires": { - "@babel/helper-validator-identifier": "^7.15.7", - "chalk": "^2.0.0", - "js-tokens": "^4.0.0" - }, - "dependencies": { - "chalk": { - "version": "2.4.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", - "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", - "dev": true, - "requires": { - "ansi-styles": "^3.2.1", - "escape-string-regexp": "^1.0.5", - "supports-color": "^5.3.0" - } - }, - "escape-string-regexp": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", - "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", - "dev": true - } - } - }, "@cspotcode/source-map-consumer": { "version": "0.8.0", "resolved": "https://registry.npmjs.org/@cspotcode/source-map-consumer/-/source-map-consumer-0.8.0.tgz", @@ -65,25 +20,25 @@ } }, "@es-joy/jsdoccomment": { - "version": "0.12.0", - "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.12.0.tgz", - "integrity": "sha512-Gw4/j9v36IKY8ET+W0GoOzrRw17xjf21EIFFRL3zx21fF5MnqmeNpNi+PU/LKjqLpPb2Pw2XdlJbYM31VVo/PQ==", + "version": "0.13.0", + "resolved": "https://registry.npmjs.org/@es-joy/jsdoccomment/-/jsdoccomment-0.13.0.tgz", + "integrity": "sha512-APVqbVPGOprb4BmjEnwbSzV+V2e/6DVIUnZG3zdW5uWXWkN0DKMCpiIy2TdBauoANKYO7RQpO8cTjIYNVSKwUA==", "dev": true, "requires": { - "comment-parser": "1.2.4", + "comment-parser": "1.3.0", "esquery": "^1.4.0", "jsdoc-type-pratt-parser": "2.0.0" } }, "@eslint/eslintrc": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.4.tgz", - "integrity": "sha512-h8Vx6MdxwWI2WM8/zREHMoqdgLNXEL4QX3MWSVMdyNJGvXVOs+6lp+m2hc3FnuMHDc4poxFNI20vCk0OmI4G0Q==", + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/@eslint/eslintrc/-/eslintrc-1.0.5.tgz", + "integrity": "sha512-BLxsnmK3KyPunz5wmCCpqy0YelEoxxGmH73Is+Z74oOTMtExcjkr3dDR6quwrjh1YspA8DH9gnX1o069KiS9AQ==", "dev": true, "requires": { "ajv": "^6.12.4", "debug": "^4.3.2", - "espree": "^9.0.0", + "espree": "^9.2.0", "globals": "^13.9.0", "ignore": "^4.0.6", "import-fresh": "^3.2.1", @@ -101,12 +56,12 @@ } }, "@humanwhocodes/config-array": { - "version": "0.6.0", - "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.6.0.tgz", - "integrity": "sha512-JQlEKbcgEUjBFhLIF4iqM7u/9lwgHRBcpHrmUNCALK0Q3amXN6lxdoXLnF0sm11E9VqTmBALR87IlUg1bZ8A9A==", + "version": "0.9.2", + "resolved": "https://registry.npmjs.org/@humanwhocodes/config-array/-/config-array-0.9.2.tgz", + "integrity": "sha512-UXOuFCGcwciWckOpmfKDq/GyhlTf9pN/BzG//x8p8zTOFEcGuA68ANXheFS0AGvy3qgZqLBUkMs7hqzqCKOVwA==", "dev": true, "requires": { - "@humanwhocodes/object-schema": "^1.2.0", + "@humanwhocodes/object-schema": "^1.2.1", "debug": "^4.1.1", "minimatch": "^3.0.4" } @@ -168,9 +123,9 @@ "dev": true }, "@types/chai": { - "version": "4.2.22", - "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.2.22.tgz", - "integrity": "sha512-tFfcE+DSTzWAgifkjik9AySNqIyNoYwmR+uecPwwD/XRNfvOjmC/FjCxpiUGDkDVDphPfCUecSQVFw+lN3M3kQ==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/@types/chai/-/chai-4.3.0.tgz", + "integrity": "sha512-/ceqdqeRraGolFTcfoXNiqjyQhZzbINDngeoAq9GoHa8PPK1yNzTaxWjA6BFWp5Ua9JpXEMSS4s5i9tS0hOJtw==", "dev": true }, "@types/faker": { @@ -192,9 +147,9 @@ "dev": true }, "@types/lodash": { - "version": "4.14.177", - "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.177.tgz", - "integrity": "sha512-0fDwydE2clKe9MNfvXHBHF9WEahRuj+msTuQqOmAApNORFvhMYZKNGGJdCzuhheVjMps/ti0Ak/iJPACMaevvw==" + "version": "4.14.178", + "resolved": "https://registry.npmjs.org/@types/lodash/-/lodash-4.14.178.tgz", + "integrity": "sha512-0d5Wd09ItQWH1qFbEyQ7oTQ3GZrMfth5JkbN3EvTKLXcHLRDSXeLnlvlOn0wvxVIwK5o2M8JzP/OWz7T3NRsbw==" }, "@types/mocha": { "version": "9.0.0", @@ -203,31 +158,18 @@ "dev": true }, "@types/node": { - "version": "16.11.7", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.11.7.tgz", - "integrity": "sha512-QB5D2sqfSjCmTuWcBWyJ+/44bcjO7VbjSbOE0ucoVbAsSNQc4Lt6QkgkVXkTDwkL4z/beecZNDvVX15D4P8Jbw==" - }, - "@types/parse-json": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/@types/parse-json/-/parse-json-4.0.0.tgz", - "integrity": "sha512-//oorEZjL6sbPcKUaCdIGlIUeH26mgzimjBB77G6XRgnDl/L5wOnpyBGRe/Mmf5CVW3PwEBE1NjiMZ/ssFh4wA==", - "dev": true + "version": "17.0.5", + "resolved": "https://registry.npmjs.org/@types/node/-/node-17.0.5.tgz", + "integrity": "sha512-w3mrvNXLeDYV1GKTZorGJQivK6XLCoGwpnyJFbJVK/aTBQUxOCaa/GlFAAN3OTDFcb7h5tiFG+YXCO2By+riZw==" }, "@types/pg": { - "version": "8.6.1", - "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.1.tgz", - "integrity": "sha512-1Kc4oAGzAl7uqUStZCDvaLFqZrW9qWSjXOmBfdgyBP5La7Us6Mg4GBvRlSoaZMhQF/zSj1C8CtKMBkoiT8eL8w==", + "version": "8.6.3", + "resolved": "https://registry.npmjs.org/@types/pg/-/pg-8.6.3.tgz", + "integrity": "sha512-P0RrXJcw1hPS+KF0nBCC3FEEdZBfRsHbYtAzbY2QTc0gC4jFQvjQxIKXs0X/NgPhPI4DbAzdeW7WMCjaWjT7Pg==", "requires": { "@types/node": "*", "pg-protocol": "*", "pg-types": "^2.2.0" - }, - "dependencies": { - "@types/node": { - "version": "16.3.3", - "resolved": "https://registry.npmjs.org/@types/node/-/node-16.3.3.tgz", - "integrity": "sha512-8h7k1YgQKxKXWckzFCMfsIwn0Y61UK6tlD6y2lOb3hTOIMlK3t9/QwHOhc81TwU+RMf0As5fj7NPjroERCnejQ==" - } } }, "@types/uuid": { @@ -236,13 +178,13 @@ "integrity": "sha512-Y2mHTRAbqfFkpjldbkHGY8JIzRN6XqYRliG8/24FcHm2D2PwW24fl5xMRTVGdrb7iMrwCaIEbLWerGIkXuFWVg==" }, "@typescript-eslint/eslint-plugin": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.4.0.tgz", - "integrity": "sha512-9/yPSBlwzsetCsGEn9j24D8vGQgJkOTr4oMLas/w886ZtzKIs1iyoqFrwsX2fqYEeUwsdBpC21gcjRGo57u0eg==", + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.8.1.tgz", + "integrity": "sha512-wTZ5oEKrKj/8/366qTM366zqhIKAp6NCMweoRONtfuC07OAU9nVI2GZZdqQ1qD30WAAtcPdkH+npDwtRFdp4Rw==", "dev": true, "requires": { - "@typescript-eslint/experimental-utils": "5.4.0", - "@typescript-eslint/scope-manager": "5.4.0", + "@typescript-eslint/experimental-utils": "5.8.1", + "@typescript-eslint/scope-manager": "5.8.1", "debug": "^4.3.2", "functional-red-black-tree": "^1.0.1", "ignore": "^5.1.8", @@ -252,55 +194,55 @@ } }, "@typescript-eslint/experimental-utils": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.4.0.tgz", - "integrity": "sha512-Nz2JDIQUdmIGd6p33A+naQmwfkU5KVTLb/5lTk+tLVTDacZKoGQisj8UCxk7onJcrgjIvr8xWqkYI+DbI3TfXg==", + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/experimental-utils/-/experimental-utils-5.8.1.tgz", + "integrity": "sha512-fbodVnjIDU4JpeXWRDsG5IfIjYBxEvs8EBO8W1+YVdtrc2B9ppfof5sZhVEDOtgTfFHnYQJDI8+qdqLYO4ceww==", "dev": true, "requires": { "@types/json-schema": "^7.0.9", - "@typescript-eslint/scope-manager": "5.4.0", - "@typescript-eslint/types": "5.4.0", - "@typescript-eslint/typescript-estree": "5.4.0", + "@typescript-eslint/scope-manager": "5.8.1", + "@typescript-eslint/types": "5.8.1", + "@typescript-eslint/typescript-estree": "5.8.1", "eslint-scope": "^5.1.1", "eslint-utils": "^3.0.0" } }, "@typescript-eslint/parser": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.4.0.tgz", - "integrity": "sha512-JoB41EmxiYpaEsRwpZEYAJ9XQURPFer8hpkIW9GiaspVLX8oqbqNM8P4EP8HOZg96yaALiLEVWllA2E8vwsIKw==", + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/parser/-/parser-5.8.1.tgz", + "integrity": "sha512-K1giKHAjHuyB421SoXMXFHHVI4NdNY603uKw92++D3qyxSeYvC10CBJ/GE5Thpo4WTUvu1mmJI2/FFkz38F2Gw==", "dev": true, "requires": { - "@typescript-eslint/scope-manager": "5.4.0", - "@typescript-eslint/types": "5.4.0", - "@typescript-eslint/typescript-estree": "5.4.0", + "@typescript-eslint/scope-manager": "5.8.1", + "@typescript-eslint/types": "5.8.1", + "@typescript-eslint/typescript-estree": "5.8.1", "debug": "^4.3.2" } }, "@typescript-eslint/scope-manager": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.4.0.tgz", - "integrity": "sha512-pRxFjYwoi8R+n+sibjgF9iUiAELU9ihPBtHzocyW8v8D8G8KeQvXTsW7+CBYIyTYsmhtNk50QPGLE3vrvhM5KA==", + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/scope-manager/-/scope-manager-5.8.1.tgz", + "integrity": "sha512-DGxJkNyYruFH3NIZc3PwrzwOQAg7vvgsHsHCILOLvUpupgkwDZdNq/cXU3BjF4LNrCsVg0qxEyWasys5AiJ85Q==", "dev": true, "requires": { - "@typescript-eslint/types": "5.4.0", - "@typescript-eslint/visitor-keys": "5.4.0" + "@typescript-eslint/types": "5.8.1", + "@typescript-eslint/visitor-keys": "5.8.1" } }, "@typescript-eslint/types": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.4.0.tgz", - "integrity": "sha512-GjXNpmn+n1LvnttarX+sPD6+S7giO+9LxDIGlRl4wK3a7qMWALOHYuVSZpPTfEIklYjaWuMtfKdeByx0AcaThA==", + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/types/-/types-5.8.1.tgz", + "integrity": "sha512-L/FlWCCgnjKOLefdok90/pqInkomLnAcF9UAzNr+DSqMC3IffzumHTQTrINXhP1gVp9zlHiYYjvozVZDPleLcA==", "dev": true }, "@typescript-eslint/typescript-estree": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.4.0.tgz", - "integrity": "sha512-nhlNoBdhKuwiLMx6GrybPT3SFILm5Gij2YBdPEPFlYNFAXUJWX6QRgvi/lwVoadaQEFsizohs6aFRMqsXI2ewA==", + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/typescript-estree/-/typescript-estree-5.8.1.tgz", + "integrity": "sha512-26lQ8l8tTbG7ri7xEcCFT9ijU5Fk+sx/KRRyyzCv7MQ+rZZlqiDPtMKWLC8P7o+dtCnby4c+OlxuX1tp8WfafQ==", "dev": true, "requires": { - "@typescript-eslint/types": "5.4.0", - "@typescript-eslint/visitor-keys": "5.4.0", + "@typescript-eslint/types": "5.8.1", + "@typescript-eslint/visitor-keys": "5.8.1", "debug": "^4.3.2", "globby": "^11.0.4", "is-glob": "^4.0.3", @@ -309,21 +251,13 @@ } }, "@typescript-eslint/visitor-keys": { - "version": "5.4.0", - "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.4.0.tgz", - "integrity": "sha512-PVbax7MeE7tdLfW5SA0fs8NGVVr+buMPrcj+CWYWPXsZCH8qZ1THufDzbXm1xrZ2b2PA1iENJ0sRq5fuUtvsJg==", + "version": "5.8.1", + "resolved": "https://registry.npmjs.org/@typescript-eslint/visitor-keys/-/visitor-keys-5.8.1.tgz", + "integrity": "sha512-SWgiWIwocK6NralrJarPZlWdr0hZnj5GXHIgfdm8hNkyKvpeQuFyLP6YjSIe9kf3YBIfU6OHSZLYkQ+smZwtNg==", "dev": true, "requires": { - "@typescript-eslint/types": "5.4.0", + "@typescript-eslint/types": "5.8.1", "eslint-visitor-keys": "^3.0.0" - }, - "dependencies": { - "eslint-visitor-keys": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", - "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", - "dev": true - } } }, "@ungap/promise-all-settled": { @@ -426,6 +360,12 @@ "integrity": "sha512-58S9QDqG0Xx27YwPSt9fJxivjYl432YCwfDMfZ+71RAqUrZef7LrKQZ3LHLOwCS4FLNBplP533Zx895SeOCHvA==", "dev": true }, + "argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "dev": true + }, "array-includes": { "version": "3.1.4", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.4.tgz", @@ -817,12 +757,6 @@ "wrap-ansi": "^7.0.0" } }, - "clone": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/clone/-/clone-2.1.2.tgz", - "integrity": "sha1-G39Ln1kfHo+DZwQBYANFoCiHQ18=", - "dev": true - }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -851,9 +785,9 @@ "dev": true }, "comment-parser": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.2.4.tgz", - "integrity": "sha512-pm0b+qv+CkWNriSTMsfnjChF9kH0kxz55y44Wo5le9qLxMj5xDQAaEd9ZN1ovSuk9CsrncWaFwgpOMg7ClJwkw==", + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/comment-parser/-/comment-parser-1.3.0.tgz", + "integrity": "sha512-hRpmWIKgzd81vn0ydoWoyPoALEOnF4wt8yKD35Ib1D6XC2siLiYaiqfGkYrunuKdsXGwpBpHU3+9r+RVw2NZfA==", "dev": true }, "concat-map": { @@ -868,33 +802,6 @@ "integrity": "sha512-gNld/3lySHwuhaVluJUKLePYirM3QNCKzVxqAdhJII9/WXKVX5PURzMVJspS1jTslSqjeuG4KMVTSouit5YPHA==", "dev": true }, - "cosmiconfig": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.1.tgz", - "integrity": "sha512-a1YWNUV2HwGimB7dU2s1wUMurNKjpx60HxBB6xUM8Re+2s1g1IIfJvFR0/iCF+XHdE0GMTKTuLR32UQff4TEyQ==", - "dev": true, - "requires": { - "@types/parse-json": "^4.0.0", - "import-fresh": "^3.2.1", - "parse-json": "^5.0.0", - "path-type": "^4.0.0", - "yaml": "^1.10.0" - }, - "dependencies": { - "parse-json": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", - "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", - "dev": true, - "requires": { - "@babel/code-frame": "^7.0.0", - "error-ex": "^1.3.1", - "json-parse-even-better-errors": "^2.3.0", - "lines-and-columns": "^1.1.6" - } - } - } - }, "create-require": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/create-require/-/create-require-1.1.1.tgz", @@ -1059,13 +966,13 @@ "dev": true }, "eslint": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.2.0.tgz", - "integrity": "sha512-erw7XmM+CLxTOickrimJ1SiF55jiNlVSp2qqm0NuBWPtHYQCegD5ZMaW0c3i5ytPqL+SSLaCxdvQXFPLJn+ABw==", + "version": "8.5.0", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.5.0.tgz", + "integrity": "sha512-tVGSkgNbOfiHyVte8bCM8OmX+xG9PzVG/B4UCF60zx7j61WIVY/AqJECDgpLD4DbbESD0e174gOg3ZlrX15GDg==", "dev": true, "requires": { - "@eslint/eslintrc": "^1.0.4", - "@humanwhocodes/config-array": "^0.6.0", + "@eslint/eslintrc": "^1.0.5", + "@humanwhocodes/config-array": "^0.9.2", "ajv": "^6.10.0", "chalk": "^4.0.0", "cross-spawn": "^7.0.2", @@ -1073,10 +980,10 @@ "doctrine": "^3.0.0", "enquirer": "^2.3.5", "escape-string-regexp": "^4.0.0", - "eslint-scope": "^6.0.0", + "eslint-scope": "^7.1.0", "eslint-utils": "^3.0.0", - "eslint-visitor-keys": "^3.0.0", - "espree": "^9.0.0", + "eslint-visitor-keys": "^3.1.0", + "espree": "^9.2.0", "esquery": "^1.4.0", "esutils": "^2.0.2", "fast-deep-equal": "^3.1.3", @@ -1105,21 +1012,15 @@ }, "dependencies": { "eslint-scope": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-6.0.0.tgz", - "integrity": "sha512-uRDL9MWmQCkaFus8RF5K9/L/2fn+80yoW3jkD53l4shjCh26fCtvJGasxjUqP5OT87SYTxCVA3BwTUzuELx9kA==", + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-7.1.0.tgz", + "integrity": "sha512-aWwkhnS0qAXqNOgKOK0dJ2nvzEbhEvpy8OlJ9kZ0FeZnA6zpjv1/Vei+puGFFX7zkPCkHHXb7IDX3A+7yPrRWg==", "dev": true, "requires": { "esrecurse": "^4.3.0", "estraverse": "^5.2.0" } }, - "eslint-visitor-keys": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", - "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", - "dev": true - }, "estraverse": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", @@ -1164,25 +1065,12 @@ } }, "eslint-config-airbnb-typescript": { - "version": "15.0.0", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-15.0.0.tgz", - "integrity": "sha512-DTWGwqytbTnB8kSKtmkrGkRf3xwTs2l15shSH0w/3Img47AQwCCrIA/ON/Uj0XXBxP31LHyEItPXeuH3mqCNLA==", + "version": "16.1.0", + "resolved": "https://registry.npmjs.org/eslint-config-airbnb-typescript/-/eslint-config-airbnb-typescript-16.1.0.tgz", + "integrity": "sha512-W5Cq20KpEx5ZLC54bnVrC37zq2+WD956Kp/Ma3nYFRjT1v9KM63v+DPkrrmmrVqrlDKaD0ivm/qeYmyHV6qKlw==", "dev": true, "requires": { - "eslint-config-airbnb-base": "^14.2.1" - }, - "dependencies": { - "eslint-config-airbnb-base": { - "version": "14.2.1", - "resolved": "https://registry.npmjs.org/eslint-config-airbnb-base/-/eslint-config-airbnb-base-14.2.1.tgz", - "integrity": "sha512-GOrQyDtVEc1Xy20U7vsB2yAoB4nBlfH5HZJeatRXHleO+OS5Ot+MWij4Dpltw4/DyIkqUfqz1epfhVR5XWWQPA==", - "dev": true, - "requires": { - "confusing-browser-globals": "^1.0.10", - "object.assign": "^4.1.2", - "object.entries": "^1.1.2" - } - } + "eslint-config-airbnb-base": "^15.0.0" } }, "eslint-config-prettier": { @@ -1291,26 +1179,37 @@ } }, "eslint-plugin-jsdoc": { - "version": "37.0.3", - "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-37.0.3.tgz", - "integrity": "sha512-Qg/gIZAfcrM4Qu/JzcnxPGD45Je6wPLFzMZQboeqit/CL4aY6wuzBTkgUMiWXfw/PaPl+sb0GF1XdBlV23ReDA==", + "version": "37.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-jsdoc/-/eslint-plugin-jsdoc-37.4.0.tgz", + "integrity": "sha512-XWKMMHFq7eUdC8XMzuQSskevJvlHTDSAJm/2qtEZ7+qhZTZ0YjeqWaUn7KGdrmxLNqtWwtJ67LdIPgrYUZ5EoA==", "dev": true, "requires": { - "@es-joy/jsdoccomment": "0.12.0", - "comment-parser": "1.2.4", - "debug": "^4.3.2", + "@es-joy/jsdoccomment": "0.13.0", + "comment-parser": "1.3.0", + "debug": "^4.3.3", + "escape-string-regexp": "^4.0.0", "esquery": "^1.4.0", "jsdoc-type-pratt-parser": "^2.0.0", - "lodash": "^4.17.21", "regextras": "^0.8.0", "semver": "^7.3.5", "spdx-expression-parse": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + } } }, "eslint-plugin-mocha": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-9.0.0.tgz", - "integrity": "sha512-d7knAcQj1jPCzZf3caeBIn3BnW6ikcvfz0kSqQpwPYcVGLoJV5sz0l0OJB2LR8I7dvTDbqq1oV6ylhSgzA10zg==", + "version": "10.0.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-10.0.3.tgz", + "integrity": "sha512-9mM7PZGxfejpjey+MrG0Cu3Lc8MyA5E2s7eUCdHXgS4SY/H9zLuwa7wVAjnEaoDjbBilA+0bPEB+iMO7lBUPcg==", "dev": true, "requires": { "eslint-utils": "^3.0.0", @@ -1327,9 +1226,9 @@ } }, "eslint-plugin-promise": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-5.1.1.tgz", - "integrity": "sha512-XgdcdyNzHfmlQyweOPTxmc7pIsS6dE4MvwhXWMQ2Dxs1XAL2GJDilUsjWen6TWik0aSI+zD/PqocZBblcm9rdA==", + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-6.0.0.tgz", + "integrity": "sha512-7GPezalm5Bfi/E22PnQxDWH2iW9GTvAlUNTztemeHb6c1BniSyoeTrM87JkC0wYdi6aQrZX9p2qEiAno8aTcbw==", "dev": true }, "eslint-plugin-security": { @@ -1358,29 +1257,37 @@ "dev": true, "requires": { "eslint-visitor-keys": "^2.0.0" + }, + "dependencies": { + "eslint-visitor-keys": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", + "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "dev": true + } } }, "eslint-visitor-keys": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz", - "integrity": "sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", + "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", "dev": true }, "espree": { - "version": "9.0.0", - "resolved": "https://registry.npmjs.org/espree/-/espree-9.0.0.tgz", - "integrity": "sha512-r5EQJcYZ2oaGbeR0jR0fFVijGOcwai07/690YRXLINuhmVeRY4UKSAsQPe/0BNuDgwP7Ophoc1PRsr2E3tkbdQ==", + "version": "9.2.0", + "resolved": "https://registry.npmjs.org/espree/-/espree-9.2.0.tgz", + "integrity": "sha512-oP3utRkynpZWF/F2x/HZJ+AGtnIclaR7z1pYPxy7NYM2fSO6LgK/Rkny8anRSPK/VwEA1eqm2squui0T7ZMOBg==", "dev": true, "requires": { - "acorn": "^8.5.0", + "acorn": "^8.6.0", "acorn-jsx": "^5.3.1", - "eslint-visitor-keys": "^3.0.0" + "eslint-visitor-keys": "^3.1.0" }, "dependencies": { - "eslint-visitor-keys": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-3.1.0.tgz", - "integrity": "sha512-yWJFpu4DtjsWKkt5GeNBBuZMlNcYVs6vRCLoCVEJrTjaSB6LC98gFipNK/erM2Heg/E8mIK+hXG/pJMLK+eRZA==", + "acorn": { + "version": "8.7.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-8.7.0.tgz", + "integrity": "sha512-V/LGr1APy+PXIwKebEWrkZPwoeoF+w1jiOBUmuxuiUIaOHtob8Qc9BTrYo7VuI5fR8tqsy+buA2WFooR5olqvQ==", "dev": true } } @@ -1744,9 +1651,9 @@ "dev": true }, "ignore": { - "version": "5.1.8", - "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.8.tgz", - "integrity": "sha512-BMpfD7PpiETpBl/A6S498BaIJ6Y/ABT93ETbby2fP00v4EbvPBXWEoaR1UBPKs3iR53pJY7EtZk5KACI57i1Uw==", + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.2.0.tgz", + "integrity": "sha512-CmxgYGiEPCLhfLnpPp1MoRmifwEIOgjcHXxOBjv7mY96c+eWScsOP9c112ZyLdWHi0FxHjI+4uVhKYp/gcdRmQ==", "dev": true }, "import-fresh": { @@ -1957,12 +1864,6 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, - "js-tokens": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", - "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", - "dev": true - }, "js-yaml": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", @@ -1992,12 +1893,6 @@ "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", "dev": true }, - "json-parse-even-better-errors": { - "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", @@ -2035,10 +1930,10 @@ "type-check": "~0.4.0" } }, - "lines-and-columns": { - "version": "1.1.6", - "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.1.6.tgz", - "integrity": "sha1-HADHQ7QzzQpOgHWPe2SldEDZ/wA=", + "lilconfig": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/lilconfig/-/lilconfig-2.0.4.tgz", + "integrity": "sha512-bfTIN7lEsiooCocSISTWXkiWJkRqtL9wYtYy+8EK3Y41qh3mpwPU0ycTOgjdY9ErwXCc8QyrQp82bdL0Xkm9yA==", "dev": true }, "linkify-it": { @@ -2051,59 +1946,60 @@ } }, "lint-staged": { - "version": "12.0.2", - "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-12.0.2.tgz", - "integrity": "sha512-tpCvACqc7bykziGJmXG0G8YG2RaCrWiDBwmrP9wU7i/3za9JMOvCECQmXjw/sO4ICC70ApVwyqixS1htQX9Haw==", + "version": "12.1.4", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-12.1.4.tgz", + "integrity": "sha512-RgDz9nsFsE0/5eL9Vat0AvCuk0+j5mEuzBIVfrRH5FRtt5wibYe8zTjZs2nuqLFrLAGQGYnj8+HJxolcj08i/A==", "dev": true, "requires": { - "cli-truncate": "3.1.0", + "cli-truncate": "^3.1.0", "colorette": "^2.0.16", "commander": "^8.3.0", - "cosmiconfig": "^7.0.1", - "debug": "^4.3.2", + "debug": "^4.3.3", "execa": "^5.1.1", - "listr2": "^3.13.3", + "lilconfig": "2.0.4", + "listr2": "^3.13.5", "micromatch": "^4.0.4", "normalize-path": "^3.0.0", - "object-inspect": "1.11.0", - "string-argv": "0.3.1", - "supports-color": "9.0.2" + "object-inspect": "^1.11.1", + "string-argv": "^0.3.1", + "supports-color": "^9.2.1", + "yaml": "^1.10.2" }, "dependencies": { - "has-flag": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-5.0.1.tgz", - "integrity": "sha512-CsNUt5x9LUdx6hnk/E2SZLsDyvfqANZSUq4+D3D8RzDJ2M+HDTIkF60ibS1vHaK55vzgiZw1bEPFG9yH7l33wA==", - "dev": true + "debug": { + "version": "4.3.3", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.3.tgz", + "integrity": "sha512-/zxw5+vh1Tfv+4Qn7a5nsbcJKPaSvCDhojn6FEl9vupwK2VCSDtEiEtqr8DFtzYFOdz63LBkxec7DYuc2jon6Q==", + "dev": true, + "requires": { + "ms": "2.1.2" + } }, "object-inspect": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.11.0.tgz", - "integrity": "sha512-jp7ikS6Sd3GxQfZJPyH3cjcbJF6GZPClgdV+EFygjFLQ5FmW/dRUnTd9PQ9k0JhoNDabWFbpF1yCdSWCC6gexg==", + "version": "1.12.0", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.12.0.tgz", + "integrity": "sha512-Ho2z80bVIvJloH+YzRmpZVQe87+qASmBUKZDWgx9cu+KDrX2ZDH/3tMy+gXbZETVGs2M8YdxObOh7XAtim9Y0g==", "dev": true }, "supports-color": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.0.2.tgz", - "integrity": "sha512-ii6tc8ImGFrgMPYq7RVAMKkhPo9vk8uA+D3oKbJq/3Pk2YSMv1+9dUAesa9UxMbxBTvxwKTQffBahNVNxEvM8Q==", - "dev": true, - "requires": { - "has-flag": "^5.0.0" - } + "version": "9.2.1", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-9.2.1.tgz", + "integrity": "sha512-Obv7ycoCTG51N7y175StI9BlAXrmgZrFhZOb0/PyjHBher/NmsdBgbbQ1Inhq+gIhz6+7Gb+jWF2Vqi7Mf1xnQ==", + "dev": true } } }, "listr2": { - "version": "3.13.3", - "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.13.3.tgz", - "integrity": "sha512-VqAgN+XVfyaEjSaFewGPcDs5/3hBbWVaX1VgWv2f52MF7US45JuARlArULctiB44IIcEk3JF7GtoFCLqEdeuPA==", + "version": "3.13.5", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-3.13.5.tgz", + "integrity": "sha512-3n8heFQDSk+NcwBn3CgxEibZGaRzx+pC64n3YjpMD1qguV4nWus3Al+Oo3KooqFKTQEJ1v7MmnbnyyNspgx3NA==", "dev": true, "requires": { "cli-truncate": "^2.1.0", - "clone": "^2.1.2", "colorette": "^2.0.16", "log-update": "^4.0.0", "p-map": "^4.0.0", + "rfdc": "^1.3.0", "rxjs": "^7.4.0", "through": "^2.3.8", "wrap-ansi": "^7.0.0" @@ -2297,14 +2193,6 @@ "linkify-it": "^3.0.1", "mdurl": "^1.0.1", "uc.micro": "^1.0.5" - }, - "dependencies": { - "argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", - "dev": true - } } }, "markdownlint": { @@ -2317,16 +2205,16 @@ } }, "markdownlint-cli": { - "version": "0.29.0", - "resolved": "https://registry.npmjs.org/markdownlint-cli/-/markdownlint-cli-0.29.0.tgz", - "integrity": "sha512-SEXRUT1ri9sXV8xQK88vjGAgmz2X9rxEG2tXdDZMljzW8e++LNTO9zzBBStx3JQWrTDoGTPHNrcurbuiyF97gw==", + "version": "0.30.0", + "resolved": "https://registry.npmjs.org/markdownlint-cli/-/markdownlint-cli-0.30.0.tgz", + "integrity": "sha512-NiG8iERjwsRZtJAIyLMDdYL2O3bJVn3fUxzDl+6Iv61/YYz9H9Nzgke/v0/cW9HfGvgZHhbfI19LFMp6gbKdyw==", "dev": true, "requires": { - "commander": "~8.2.0", + "commander": "~8.3.0", "deep-extend": "~0.6.0", "get-stdin": "~8.0.0", "glob": "~7.2.0", - "ignore": "~5.1.8", + "ignore": "~5.1.9", "js-yaml": "^4.1.0", "jsonc-parser": "~3.0.0", "lodash.differencewith": "~4.5.0", @@ -2338,10 +2226,10 @@ "run-con": "~1.2.10" }, "dependencies": { - "commander": { - "version": "8.2.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-8.2.0.tgz", - "integrity": "sha512-LLKxDvHeL91/8MIyTAD5BFMNtoIwztGPMiM/7Bl8rIPmHCZXRxmSWr91h57dpOpnQ6jIUqEWdXE/uBYMfiVZDA==", + "ignore": { + "version": "5.1.9", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.9.tgz", + "integrity": "sha512-2zeMQpbKz5dhZ9IwL0gbxSW5w0NK/MSAMtNuhgIHEPmaU3vPdKPL0UdvUCXs5SS4JAwsBxysK5sFMW8ocFiVjQ==", "dev": true } } @@ -3088,9 +2976,9 @@ "dev": true }, "prettier": { - "version": "2.4.1", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.4.1.tgz", - "integrity": "sha512-9fbDAXSBcc6Bs1mZrDYb3XKzDLm4EXXL9sC1LqKP5rZkT6KRr/rf9amVUcODVXgguK/isJz0d0hP72WeaKWsvA==", + "version": "2.5.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.5.1.tgz", + "integrity": "sha512-vBZcPRUR5MZJwoyi3ZoyQlc1rXeEck8KgeC9AwwOn+exuxLxq5toTRDTSaVrXHxelDMHy9zlicw8u66yxoSUFg==", "dev": true }, "prettier-linter-helpers": { @@ -3232,6 +3120,12 @@ "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", "dev": true }, + "rfdc": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.3.0.tgz", + "integrity": "sha512-V2hovdzFbOi77/WajaSMXk2OLm+xNIeQdMMuB7icj7bk6zi2F8GGAxigcnDFpJHbNyNcgyJDiP+8nOrY5cZGrA==", + "dev": true + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -3263,18 +3157,18 @@ } }, "rxjs": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.4.0.tgz", - "integrity": "sha512-7SQDi7xeTMCJpqViXh8gL/lebcwlp3d831F05+9B44A4B0WfsEwUQHR64gsH1kvJ+Ep/J9K2+n1hVl1CsGN23w==", + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.5.0.tgz", + "integrity": "sha512-fuCKAfFawVYX0pyFlETtYnXI+5iiY9Dftgk+VdgeOq+Qyi9ZDWckHZRDaXRt5WCNbbLkmAheoSGDiceyCIKNZA==", "dev": true, "requires": { - "tslib": "~2.1.0" + "tslib": "^2.1.0" }, "dependencies": { "tslib": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", - "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==", + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.3.1.tgz", + "integrity": "sha512-77EbyPPpMz+FRFRuAFlWMtmgUWGe9UOG2Z25NqCwiIjRhOf5iKGuzSe5P2w1laq+FkRy4p+PCuVkJSGkzTEKVw==", "dev": true } } @@ -3344,9 +3238,9 @@ } }, "signal-exit": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.5.tgz", - "integrity": "sha512-KWcOiKeQj6ZyXx7zq4YxSMgHRlod4czeBQZrPb8OKcohcqAXShm7E20kEMle9WBt26hFcAf0qLOcp5zmY7kOqQ==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.6.tgz", + "integrity": "sha512-sDl4qMFpijcGw22U5w63KmD3cZJfBuFlVNbVMKje2keoKML7X2UzWbc4XrmEbDwg0NXJc3yv4/ox7b+JWb57kQ==", "dev": true }, "slash": { @@ -3623,9 +3517,9 @@ "dev": true }, "typescript": { - "version": "4.4.4", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.4.4.tgz", - "integrity": "sha512-DqGhF5IKoBl8WNf8C1gu8q0xZSInh9j1kJJMqT3a94w1JzVaBU4EXOSMrz9yDqMT0xt3selp83fuFMQ0uzv6qA==", + "version": "4.5.4", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-4.5.4.tgz", + "integrity": "sha512-VgYs2A2QIRuGphtzFV7aQJduJ2gyfTljngLzjpfW9FoYZF6xuw1W0vW9ghCKLfcWrCFxK81CSGRAvS1pn4fIUg==", "dev": true }, "uc.micro": { diff --git a/package.json b/package.json index 02793c5..a81fdc9 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bigal", - "version": "9.2.1", + "version": "9.2.2", "description": "A fast and lightweight orm for postgres and node.js, written in typescript.", "main": "index.js", "types": "index.d.ts", @@ -19,44 +19,46 @@ "node": ">=12" }, "dependencies": { - "@types/lodash": "^4.14.177", - "@types/node": "^16.11.7", - "@types/pg": "^8.6.1", + "@types/lodash": "^4.14.178", + "@types/node": "^17.0.5", + "@types/pg": "^8.6.3", "lodash": "^4.17.21", "pg": "8.7.1", "postgres-pool": "^5.0.8" }, "devDependencies": { - "@types/chai": "^4.2.22", + "@types/chai": "^4.3.0", "@types/faker": "^5.5.9", "@types/mocha": "^9.0.0", - "@typescript-eslint/eslint-plugin": "^5.4.0", - "@typescript-eslint/parser": "^5.4.0", + "@typescript-eslint/eslint-plugin": "^5.8.1", + "@typescript-eslint/parser": "^5.8.1", "chai": "^4.3.4", - "eslint": "^8.2.0", + "eslint": "^8.5.0", "eslint-config-airbnb-base": "^15.0.0", - "eslint-config-airbnb-typescript": "^15.0.0", + "eslint-config-airbnb-typescript": "^16.1.0", "eslint-config-prettier": "^8.3.0", "eslint-plugin-import": "^2.25.3", - "eslint-plugin-jsdoc": "^37.0.3", - "eslint-plugin-mocha": "^9.0.0", + "eslint-plugin-jsdoc": "^37.4.0", + "eslint-plugin-mocha": "^10.0.3", "eslint-plugin-prettier": "^4.0.0", - "eslint-plugin-promise": "^5.1.1", + "eslint-plugin-promise": "^6.0.0", "eslint-plugin-security": "^1.4.0", "faker": "^5.5.3", "husky": "^7.0.4", - "lint-staged": "^12.0.2", - "markdownlint-cli": "^0.29.0", + "lint-staged": "^12.1.4", + "markdownlint-cli": "^0.30.0", "mocha": "^9.1.3", "npm-run-all": "^4.1.5", "pinst": "^2.1.6", - "prettier": "^2.4.1", + "prettier": "^2.5.1", + "rimraf": "^3.0.2", "strict-event-emitter-types": "^2.0.0", "ts-mockito": "^2.6.1", "ts-node": "^10.4.0", - "typescript": "^4.4.4" + "typescript": "^4.5.4" }, "scripts": { + "prebuild": "rimraf dist", "build": "tsc", "test": "mocha -r ts-node/register tests/**/*.tests.ts", "lint:markdown": "prettier --write '*.md' '!(node_modules|dist)/**/*.md' && markdownlint '*.md' '!(node_modules|dist)/**/*.md' --config=.github/linters/.markdown-lint.yml --fix", diff --git a/src/ReadonlyRepository.ts b/src/ReadonlyRepository.ts index 8e00042..d7632f6 100644 --- a/src/ReadonlyRepository.ts +++ b/src/ReadonlyRepository.ts @@ -74,7 +74,7 @@ export class ReadonlyRepository implements IReadonlyRepository public findOne(args: FindOneArgs | WhereQuery = {}): FindOneResult> { const { stack } = new Error(`${this.model.name}.findOne()`); - let select: (string & keyof OmitFunctionsAndEntityCollections)[] | undefined; + let select: Set> | undefined; let where: WhereQuery = {}; let sort: SortObject | string | null = null; let poolOverride: Pool | undefined; @@ -84,7 +84,10 @@ export class ReadonlyRepository implements IReadonlyRepository switch (name) { case 'select': - select = value as (string & keyof OmitFunctionsAndEntityCollections)[]; + if (value) { + select = new Set(value as (string & keyof OmitFunctionsAndEntityCollections)[]); + } + break; case 'where': where = value as WhereQuery; @@ -145,6 +148,15 @@ export class ReadonlyRepository implements IReadonlyRepository propertyName: TProperty, options?: PopulateArgs[TProperty], Entity>>, ): FindOneResult, TProperty> & PickAsPopulated> { + // Add the column if the property is a single relation and not included in the list of select columns + if (select && !select.has(propertyName as unknown as string & keyof OmitFunctionsAndEntityCollections)) { + for (const column of modelInstance.model.columns) { + if ((column as ColumnModelMetadata).model && column.propertyName === propertyName) { + select.add(column.propertyName as string & keyof OmitFunctionsAndEntityCollections); + } + } + } + populates.push({ propertyName, where: options?.where, @@ -193,7 +205,7 @@ export class ReadonlyRepository implements IReadonlyRepository const { query, params } = getSelectQueryAndParams({ repositoriesByModelNameLowered: modelInstance._repositoriesByModelNameLowered, model: modelInstance.model, - select, + select: select ? Array.from(select) : undefined, where, sorts, limit: 1, @@ -247,7 +259,7 @@ export class ReadonlyRepository implements IReadonlyRepository public find(args: FindArgs | WhereQuery = {}): FindResult> { const { stack } = new Error(`${this.model.name}.find()`); - let select: (string & keyof OmitFunctionsAndEntityCollections)[] | undefined; + let select: Set> | undefined; let where: WhereQuery = {}; let sort: SortObject | string | null = null; let skip: number | null = null; @@ -259,7 +271,10 @@ export class ReadonlyRepository implements IReadonlyRepository switch (name) { case 'select': - select = value as (string & keyof OmitFunctionsAndEntityCollections)[]; + if (value) { + select = new Set(value as (string & keyof OmitFunctionsAndEntityCollections)[]); + } + break; case 'where': where = value as WhereQuery; @@ -321,6 +336,15 @@ export class ReadonlyRepository implements IReadonlyRepository propertyName: TProperty, options?: PopulateArgs[TProperty], Entity>>, ): FindResult, TProperty> & PickAsPopulated> { + // Add the column if the property is a single relation and not included in the list of select columns + if (select && !select.has(propertyName as unknown as string & keyof OmitFunctionsAndEntityCollections)) { + for (const column of modelInstance.model.columns) { + if ((column as ColumnModelMetadata).model && column.propertyName === propertyName) { + select.add(column.propertyName as string & keyof OmitFunctionsAndEntityCollections); + } + } + } + populates.push({ propertyName, where: options?.where, @@ -387,7 +411,7 @@ export class ReadonlyRepository implements IReadonlyRepository const { query, params } = getSelectQueryAndParams({ repositoriesByModelNameLowered: modelInstance._repositoriesByModelNameLowered, model: modelInstance.model, - select, + select: select ? Array.from(select) : undefined, where, sorts, skip: skip || 0, diff --git a/src/SqlHelper.ts b/src/SqlHelper.ts index 46cb6bc..00e1f01 100644 --- a/src/SqlHelper.ts +++ b/src/SqlHelper.ts @@ -14,7 +14,7 @@ import type { CreateUpdateParams, OmitFunctionsAndEntityCollections } from './ty interface QueryAndParams { query: string; - params: unknown[]; + params: readonly unknown[]; } /* eslint-disable @typescript-eslint/no-use-before-define */ @@ -42,9 +42,9 @@ export function getSelectQueryAndParams({ }: { repositoriesByModelNameLowered: Record | IRepository>; model: ModelMetadata; - select?: (string & keyof OmitFunctionsAndEntityCollections)[]; + select?: readonly (string & keyof OmitFunctionsAndEntityCollections)[]; where?: WhereQuery; - sorts: OrderBy[]; + sorts: readonly OrderBy[]; skip: number; limit: number; }): QueryAndParams { @@ -169,7 +169,7 @@ export function getInsertQueryAndParams({ model: ModelMetadata; values: CreateUpdateParams | CreateUpdateParams[]; returnRecords?: boolean; - returnSelect?: (string & keyof OmitFunctionsAndEntityCollections)[]; + returnSelect?: readonly (string & keyof OmitFunctionsAndEntityCollections)[]; }): QueryAndParams { const entitiesToInsert = _.isArray(values) ? values : [values]; const columnsToInsert = []; @@ -437,7 +437,7 @@ export function getDeleteQueryAndParams({ model: ModelMetadata; where?: WhereQuery; returnRecords?: boolean; - returnSelect?: (string & keyof OmitFunctionsAndEntityCollections)[]; + returnSelect?: readonly (string & keyof OmitFunctionsAndEntityCollections)[]; }): QueryAndParams { let query = `DELETE FROM "${model.tableName}"`; @@ -473,26 +473,29 @@ export function getDeleteQueryAndParams({ * @returns {string} SQL columns * @private */ -export function getColumnsToSelect({ model, select }: { model: ModelMetadata; select?: (string & keyof OmitFunctionsAndEntityCollections)[] }): string { +export function getColumnsToSelect({ model, select }: { model: ModelMetadata; select?: readonly (string & keyof OmitFunctionsAndEntityCollections)[] }): string { + let selectColumns: Set; if (select) { const { primaryKeyColumn } = model; - // Include primary key column if it's not defined - if (primaryKeyColumn && !select.includes(primaryKeyColumn.propertyName as string & keyof OmitFunctionsAndEntityCollections)) { - select.push(primaryKeyColumn.propertyName as string & keyof OmitFunctionsAndEntityCollections); + selectColumns = new Set(select); + + // Ensure primary key column is specified + if (primaryKeyColumn) { + selectColumns.add(primaryKeyColumn.propertyName); } } else { // eslint-disable-next-line no-param-reassign - select = []; + selectColumns = new Set(); for (const column of model.columns) { if (!(column as ColumnCollectionMetadata).collection) { - select.push(column.propertyName as string & keyof OmitFunctionsAndEntityCollections); + selectColumns.add(column.propertyName); } } } let query = ''; - for (const [index, propertyName] of select.entries()) { + for (const [index, propertyName] of Array.from(selectColumns).entries()) { const column = model.columnsByPropertyName[propertyName]; if (!column) { throw new Error(`Unable to find column for property: ${propertyName} on ${model.tableName}`); @@ -565,7 +568,7 @@ export function buildWhereStatement({ * @returns {string} SQL order by statement * @private */ -export function buildOrderStatement({ model, sorts }: { model: ModelMetadata; sorts: OrderBy[] }): string { +export function buildOrderStatement({ model, sorts }: { model: ModelMetadata; sorts: readonly OrderBy[] }): string { if (_.isNil(sorts) || !_.some(sorts)) { return ''; } @@ -620,7 +623,7 @@ function buildWhere({ propertyName?: string; comparer?: Comparer | string; isNegated?: boolean; - value?: WhereClauseValue | WhereClauseValue | WhereQuery | WhereQuery[] | string; + value?: WhereClauseValue | WhereClauseValue | WhereQuery | string | readonly WhereQuery[]; params: unknown[]; }): string { switch (comparer || propertyName) { @@ -995,7 +998,7 @@ function buildOrOperatorStatement({ repositoriesByModelNameLowered: Record | IRepository>; model: ModelMetadata; isNegated: boolean; - value: WhereQuery[]; + value: readonly WhereQuery[]; params: unknown[]; }): string { const orClauses = []; @@ -1027,7 +1030,7 @@ interface ComparisonOperatorStatementParams { propertyName: string; comparer?: Comparer | string; isNegated: boolean; - value?: string[] | WhereClauseValue | string; + value?: WhereClauseValue | string | readonly string[]; params: unknown[]; } diff --git a/src/types/GetValueType.ts b/src/types/GetValueType.ts index 01845bb..ef7af34 100644 --- a/src/types/GetValueType.ts +++ b/src/types/GetValueType.ts @@ -1 +1 @@ -export type GetValueType = T extends TValueType[] ? (T extends (infer U)[] ? U : never) : T extends TValueType ? T : never; +export type GetValueType = T extends TValueType[] ? (T extends (infer U)[] ? Extract : never) : T extends TValueType ? T : never; diff --git a/tests/readonlyRepository.tests.ts b/tests/readonlyRepository.tests.ts index 44f9fd1..300e358 100644 --- a/tests/readonlyRepository.tests.ts +++ b/tests/readonlyRepository.tests.ts @@ -245,7 +245,7 @@ describe('ReadonlyRepository', () => { }), ]); should.exist(result); - result!.should.deep.equal(product); + result.should.deep.equal(product); const [query, params] = capture(mockedPool.query).first(); query.should.equal('SELECT "id","name","sku","alias_names" AS "aliases","store_id" AS "store" FROM "products" WHERE "id"=$1 LIMIT 1'); @@ -578,6 +578,44 @@ describe('ReadonlyRepository', () => { storeQuery.should.equal('SELECT "id","name" FROM "stores" WHERE "id"=$1'); storeQueryParams!.should.deep.equal([store.id]); }); + it('should support populating a single relation when column is missing from partial select', async () => { + const store = { + id: faker.datatype.number(), + name: `store - ${faker.datatype.uuid()}`, + }; + const product = { + id: faker.datatype.number(), + name: `product - ${faker.datatype.uuid()}`, + store, + }; + + when(mockedPool.query(anyString(), anything())).thenResolve( + getQueryResult([ + { + id: product.id, + name: product.name, + store: store.id, + }, + ]), + getQueryResult([store]), + ); + + const result = await ProductRepository.findOne({ + select: ['name'], + }).populate('store', { + select: ['name'], + }); + verify(mockedPool.query(anyString(), anything())).twice(); + should.exist(result); + result!.should.deep.equal(product); + + const [productQuery, productQueryParams] = capture(mockedPool.query).first(); + productQuery.should.equal('SELECT "name","store_id" AS "store","id" FROM "products" LIMIT 1'); + productQueryParams!.should.deep.equal([]); + const [storeQuery, storeQueryParams] = capture(mockedPool.query).second(); + storeQuery.should.equal('SELECT "name","id" FROM "stores" WHERE "id"=$1'); + storeQueryParams!.should.deep.equal([store.id]); + }); it('should support populating a single relation with partial select and order', async () => { const store = { id: faker.datatype.number(), @@ -2066,6 +2104,36 @@ describe('ReadonlyRepository', () => { storeQuery.should.equal('SELECT "id" FROM "stores" WHERE "id"=ANY($1::INTEGER[]) ORDER BY "name"'); storeQueryParams!.should.deep.equal([[store1.id, store2.id]]); }); + it('should support populating a single relation when column is missing from partial select', async () => { + when(mockedPool.query(anyString(), anything())).thenResolve( + getQueryResult([_.pick(product1, 'id', 'name', 'store'), _.pick(product2, 'id', 'name', 'store')]), + getQueryResult([_.pick(store1, 'id'), _.pick(store2, 'id')]), + ); + + const results = await ProductRepository.find({ + select: ['name'], + }).populate('store', { + select: ['id'], + }); + verify(mockedPool.query(anyString(), anything())).twice(); + results.should.deep.equal([ + { + ..._.pick(product1, 'id', 'name'), + store: _.pick(store1, 'id'), + }, + { + ..._.pick(product2, 'id', 'name'), + store: _.pick(store2, 'id'), + }, + ]); + + const [productQuery, productQueryParams] = capture(mockedPool.query).first(); + productQuery.should.equal('SELECT "name","store_id" AS "store","id" FROM "products"'); + productQueryParams!.should.deep.equal([]); + const [storeQuery, storeQueryParams] = capture(mockedPool.query).second(); + storeQuery.should.equal('SELECT "id" FROM "stores" WHERE "id"=ANY($1::INTEGER[])'); + storeQueryParams!.should.deep.equal([[store1.id, store2.id]]); + }); it('should support populating one-to-many collection', async () => { when(mockedPool.query(anyString(), anything())).thenResolve( getQueryResult([_.pick(store1, 'id', 'name'), _.pick(store2, 'id', 'name')]),