From d1809ff23b4079bce17d26ecfeb00e75336b8fbd Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Thu, 15 Oct 2020 20:57:00 +0200 Subject: [PATCH 01/13] Add prettier setup --- package-lock.json | 1252 +++++++++++++++++++++++++++++++++++++++++++++ package.json | 19 + 2 files changed, 1271 insertions(+) diff --git a/package-lock.json b/package-lock.json index 375bd675..f649d938 100644 --- a/package-lock.json +++ b/package-lock.json @@ -63,6 +63,12 @@ "@babel/types": "7.0.0-beta.44" } }, + "@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": "sha512-3U9y+43hz7ZM+rzG24Qe2mufW5KhvFg/NhnNph+i9mgCtdTCtMJuI1TMkrIUiK7Ix4PYlRF9I5dhqaLYA/ADXw==", + "dev": true + }, "@babel/highlight": { "version": "7.0.0-beta.44", "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.44.tgz", @@ -220,6 +226,12 @@ "integrity": "sha512-6XzyyNM9EKQW4HKuzbo/CkOIjn/evtCmsU+MUM1xDfJ+3/rNjBttM1NgN7AOQvN6tP1Sl1D1PIKMreTArnxM9A==", "dev": true }, + "@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 + }, "acorn": { "version": "5.7.3", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", @@ -255,6 +267,16 @@ } } }, + "aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "dev": true, + "requires": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + } + }, "ajv": { "version": "5.5.2", "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", @@ -279,6 +301,12 @@ "integrity": "sha1-l6ERlkmyEa0zaR2fn0hqjsn74KM=", "dev": true }, + "ansi-colors": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.1.tgz", + "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", + "dev": true + }, "ansi-escapes": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", @@ -323,6 +351,12 @@ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, + "astral-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-2.0.0.tgz", + "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", + "dev": true + }, "asyncro": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/asyncro/-/asyncro-3.0.0.tgz", @@ -1081,6 +1115,15 @@ "concat-map": "0.0.1" } }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, "browser-stdout": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", @@ -1317,6 +1360,12 @@ "chalk": "^1.1.3" } }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, "cli-cursor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", @@ -1326,6 +1375,85 @@ "restore-cursor": "^2.0.0" } }, + "cli-truncate": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.1.0.tgz", + "integrity": "sha512-n8fOixwDD6b/ObinzTrp1ZKFzbgvKZvuz/TvejnLn1aQfC6r52XEx85FmuC+3HI+JM7coBRXUvNqEU2PHVrHpg==", + "dev": true, + "requires": { + "slice-ansi": "^3.0.0", + "string-width": "^4.2.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "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": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "slice-ansi": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-3.0.0.tgz", + "integrity": "sha512-pSyv7bSTC7ig9Dcgbw9AuRNUb5k5V6oDudjZoMBSr13qpLBG7tB+zgCkARjq7xIUgdz5P1Qe8u+rSGdouOOIyQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + } + }, + "string-width": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.0.tgz", + "integrity": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, "cli-width": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", @@ -1411,6 +1539,12 @@ "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", "dev": true }, + "compare-versions": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.6.0.tgz", + "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", + "dev": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -1743,6 +1877,12 @@ "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, + "dedent": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", + "integrity": "sha1-JJXduvbrh0q7Dhvp3yLS5aVEMmw=", + "dev": true + }, "deep-eql": { "version": "0.1.3", "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-0.1.3.tgz", @@ -1817,12 +1957,36 @@ "integrity": "sha512-C1i/vH6/kQx9YV8RddMkmW216GwW4pTrnYIlKmDFIqXA4fPwqDxIdGyHsuG+fgurHoljRz7/oaD+tztcryW/9g==", "dev": true }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, "emojis-list": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/emojis-list/-/emojis-list-2.1.0.tgz", "integrity": "sha1-TapNnbAPmBmIDHn6RXrlsJof04k=", "dev": true }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, + "enquirer": { + "version": "2.3.6", + "resolved": "https://registry.npmjs.org/enquirer/-/enquirer-2.3.6.tgz", + "integrity": "sha512-yjNnPr315/FjS4zIsUxYguYUPP2e1NK4d7E7ZOLiyYCcbFBiTMyID+2wvm2w6+pZ/odMA7cRkjhsPbltwBOrLg==", + "dev": true, + "requires": { + "ansi-colors": "^4.1.1" + } + }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -2125,6 +2289,75 @@ "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", "dev": true }, + "execa": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/execa/-/execa-4.0.3.tgz", + "integrity": "sha512-WFDXGHckXPWZX19t1kCsXzOpqX9LWYNqn4C+HqZlk/V0imTkzJZqf87ZBhvpHaftERYknpk0fjSylnXVlVgI0A==", + "dev": true, + "requires": { + "cross-spawn": "^7.0.0", + "get-stream": "^5.0.0", + "human-signals": "^1.1.1", + "is-stream": "^2.0.0", + "merge-stream": "^2.0.0", + "npm-run-path": "^4.0.0", + "onetime": "^5.1.0", + "signal-exit": "^3.0.2", + "strip-final-newline": "^2.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", + "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", + "dev": true, + "requires": { + "path-key": "^3.1.0", + "shebang-command": "^2.0.0", + "which": "^2.0.1" + } + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "shebang-command": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", + "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", + "dev": true, + "requires": { + "shebang-regex": "^3.0.0" + } + }, + "shebang-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", + "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", + "dev": true + }, + "which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "dev": true, + "requires": { + "isexe": "^2.0.0" + } + } + } + }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", @@ -2191,12 +2424,40 @@ "integrity": "sha512-7KjR1vv6qnicaPMi1iiTcI85CyYwRO/PSFCu6SvqL8jN2Wjt/NIYQTFtFs7fSDCYOstUkEWIQGFUg5YZQfjlcg==", "dev": true }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" + } + }, "find-root": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/find-root/-/find-root-1.1.0.tgz", "integrity": "sha512-NKfW6bec6GfKc0SGx1e07QZY9PE99u0Bft/0rzSD5k3sO/vwkVUpDUKVm5Gpp5Ue3YfShPFTX2070tDs5kB9Ng==", "dev": true }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "find-versions": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/find-versions/-/find-versions-3.2.0.tgz", + "integrity": "sha512-P8WRou2S+oe222TOCHitLy8zj+SIsVJh52VP4lvXkaFVnOFFdoWv1H1Jjvel1aI6NCFOAaeAVm8qrI0odiLcww==", + "dev": true, + "requires": { + "semver-regex": "^2.0.0" + } + }, "flat-cache": { "version": "1.3.4", "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-1.3.4.tgz", @@ -2272,6 +2533,21 @@ "loader-utils": "^1.1.0" } }, + "get-own-enumerable-property-symbols": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/get-own-enumerable-property-symbols/-/get-own-enumerable-property-symbols-3.0.2.tgz", + "integrity": "sha512-I0UBV/XOz1XkIJHEUDMZAbzCThU/H8DxmSfmdGcKPnVhu2VfFqr34jr9777IyaTYvxjedWhqVIilEDsCdP5G6g==", + "dev": true + }, + "get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -2378,6 +2654,196 @@ "integrity": "sha512-P+M65QY2JQ5Y0G9KKdlDpo0zK+/OHptU5AaBwUfAIDJZk1MYf32Frm84EcOytfJE0t5JvkAnKlmjsXDnWzCJmQ==", "dev": true }, + "human-signals": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/human-signals/-/human-signals-1.1.1.tgz", + "integrity": "sha512-SEQu7vl8KjNL2eoGBLF3+wAjpsNfA9XMlXAYj/3EdaNfAlxKthD1xjEQfGOUhllCGGJVNY34bRr6lPINhNjyZw==", + "dev": true + }, + "husky": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/husky/-/husky-4.3.0.tgz", + "integrity": "sha512-tTMeLCLqSBqnflBZnlVDhpaIMucSGaYyX6855jM4AguGeWCeSzNdb1mfyWduTZ3pe3SJVvVWGL0jO1iKZVPfTA==", + "dev": true, + "requires": { + "chalk": "^4.0.0", + "ci-info": "^2.0.0", + "compare-versions": "^3.6.0", + "cosmiconfig": "^7.0.0", + "find-versions": "^3.2.0", + "opencollective-postinstall": "^2.0.2", + "pkg-dir": "^4.2.0", + "please-upgrade-node": "^3.2.0", + "slash": "^3.0.0", + "which-pm-runs": "^1.0.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "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" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "cosmiconfig": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", + "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", + "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" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "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 + }, + "parse-json": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", + "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", + "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" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -2408,6 +2874,24 @@ "import-from": "^2.1.0" } }, + "import-fresh": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.2.1.tgz", + "integrity": "sha512-6e1q1cnWP2RXD9/keSkxHScg508CdXqXWgWBaETNhyuBFz+kUZlKboh+ISK+bU++DmbHimVBrOz/zzPe0sZ3sQ==", + "dev": true, + "requires": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true + } + } + }, "import-from": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/import-from/-/import-from-2.1.0.tgz", @@ -2431,6 +2915,12 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, "indexes-of": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/indexes-of/-/indexes-of-1.0.1.tgz", @@ -2602,6 +3092,18 @@ "integrity": "sha1-Mlj7afeMFNW4FdZkM2tM/7ZEFZE=", "dev": true }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, "is-plain-obj": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", @@ -2623,12 +3125,24 @@ "has": "^1.0.3" } }, + "is-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-regexp/-/is-regexp-1.0.0.tgz", + "integrity": "sha1-/S2INUXEa6xaYz57mgnof6LLUGk=", + "dev": true + }, "is-resolvable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/is-resolvable/-/is-resolvable-1.1.0.tgz", "integrity": "sha512-qgDYXFSR5WvEfuS5dMj6oTMEbrrSaM0CrFk2Yiq/gXnBvD9pMa2jGXxyhGLfvhZpuMZe18CJpFxAt3CRs42NMg==", "dev": true }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "dev": true + }, "is-string": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/is-string/-/is-string-1.0.5.tgz", @@ -2693,6 +3207,12 @@ "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", "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.3.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", @@ -2740,6 +3260,286 @@ "type-check": "~0.3.2" } }, + "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=", + "dev": true + }, + "lint-staged": { + "version": "10.4.0", + "resolved": "https://registry.npmjs.org/lint-staged/-/lint-staged-10.4.0.tgz", + "integrity": "sha512-uaiX4U5yERUSiIEQc329vhCTDDwUcSvKdRLsNomkYLRzijk3v8V9GWm2Nz0RMVB87VcuzLvtgy6OsjoH++QHIg==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "cli-truncate": "^2.1.0", + "commander": "^6.0.0", + "cosmiconfig": "^7.0.0", + "debug": "^4.1.1", + "dedent": "^0.7.0", + "enquirer": "^2.3.6", + "execa": "^4.0.3", + "listr2": "^2.6.0", + "log-symbols": "^4.0.0", + "micromatch": "^4.0.2", + "normalize-path": "^3.0.0", + "please-upgrade-node": "^3.2.0", + "string-argv": "0.3.1", + "stringify-object": "^3.3.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.10.4.tgz", + "integrity": "sha512-vG6SvB6oYEhvgisZNFRmRCUkLz11c7rp+tbNTynGqc6mS1d5ATd/sGyV6W0KZZnXRKMTzZDRgQT3Ou9jhpAfUg==", + "dev": true, + "requires": { + "@babel/highlight": "^7.10.4" + } + }, + "@babel/highlight": { + "version": "7.10.4", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.10.4.tgz", + "integrity": "sha512-i6rgnR/YgPEQzZZnbTHHuZdlE8qyoBNalD6F+q4vAFlcMEcqmkoG+mPqJYJCo63qPf74+Y1UZsl3l6f7/RIkmA==", + "dev": true, + "requires": { + "@babel/helper-validator-identifier": "^7.10.4", + "chalk": "^2.0.0", + "js-tokens": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "^1.9.0" + } + }, + "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" + } + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "dev": true, + "requires": { + "has-flag": "^3.0.0" + } + } + } + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "commander": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-6.1.0.tgz", + "integrity": "sha512-wl7PNrYWd2y5mp1OK/LhTlv8Ff4kQJQRXXAvF+uU/TPNiVJUxZLRYGj/B0y/lPGAVcSbJqH2Za/cvHmrPMC8mA==", + "dev": true + }, + "cosmiconfig": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-7.0.0.tgz", + "integrity": "sha512-pondGvTuVYDk++upghXJabWzL6Kxu6f26ljFw64Swq9v6sQPUL3EUlVDV56diOjpCayKihL6hVe8exIACU4XcA==", + "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" + } + }, + "debug": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.2.0.tgz", + "integrity": "sha512-IX2ncY78vDTjZMFUdmsvIRFY2Cf4FnD0wRs+nQwJU8Lu99/tPFdb0VybiiMTPe3I6rQmwsqQqRBvxU+bZ/I8sg==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "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 + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "parse-json": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.1.0.tgz", + "integrity": "sha512-+mi/lmVVNKFNVyLXV31ERiy2CY5E1/F6QtJFEzoChPRwwngMNXRDQ9GJ5WdE2Z2P4AujsOi0/+2qHID68KwfIQ==", + "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" + } + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "listr2": { + "version": "2.6.2", + "resolved": "https://registry.npmjs.org/listr2/-/listr2-2.6.2.tgz", + "integrity": "sha512-6x6pKEMs8DSIpA/tixiYY2m/GcbgMplMVmhQAaLFxEtNSKLeWTGjtmU57xvv6QCm2XcqzyNXL/cTSVf4IChCRA==", + "dev": true, + "requires": { + "chalk": "^4.1.0", + "cli-truncate": "^2.1.0", + "figures": "^3.2.0", + "indent-string": "^4.0.0", + "log-update": "^4.0.0", + "p-map": "^4.0.0", + "rxjs": "^6.6.2", + "through": "^2.3.8" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "loader-utils": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/loader-utils/-/loader-utils-1.2.3.tgz", @@ -2768,6 +3568,15 @@ } } }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, "lodash": { "version": "4.17.15", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", @@ -2804,6 +3613,164 @@ "integrity": "sha1-0CJTc662Uq3BvILklFM5qEJ1R3M=", "dev": true }, + "log-symbols": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.0.0.tgz", + "integrity": "sha512-FN8JBzLx6CzeMrB0tg6pqlGU1wCrXW+ZXGH481kfsBqer0hToTIiHdjH4Mq8xJUbvATujKCvaREGWpGUionraA==", + "dev": true, + "requires": { + "chalk": "^4.0.0" + }, + "dependencies": { + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "chalk": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.0.tgz", + "integrity": "sha512-qwx12AxXe2Q5xQ43Ac//I6v5aXTipYrSESdOgzrN+9XjgEpyjpKuvSGaN4qE93f7TQTlerQQ8S+EQ0EyDoVL1A==", + "dev": true, + "requires": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, + "log-update": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/log-update/-/log-update-4.0.0.tgz", + "integrity": "sha512-9fkkDevMefjg0mmzWFBW8YkFP91OrizzkW3diF7CpG+S2EYdy4+TVfGwz1zeF8x7hCx1ovSPTOE9Ngib74qqUg==", + "dev": true, + "requires": { + "ansi-escapes": "^4.3.0", + "cli-cursor": "^3.1.0", + "slice-ansi": "^4.0.0", + "wrap-ansi": "^6.2.0" + }, + "dependencies": { + "ansi-escapes": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.1.tgz", + "integrity": "sha512-JWF7ocqNrp8u9oqpgV+wH5ftbt+cfvv+PTjOvKLT3AdYly/LmORARfEVT1iyjwN+4MqE5UmVKoAdIBqeoCHgLA==", + "dev": true, + "requires": { + "type-fest": "^0.11.0" + } + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "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": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "slice-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", + "integrity": "sha512-qMCMfhY040cVHT43K9BFygqYbUPFZKHOg7K73mtTWJRb8pyP3fzf4Ixd5SzdEJQ6MRUg/WBnOLxghZtKKurENQ==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "astral-regex": "^2.0.0", + "is-fullwidth-code-point": "^3.0.0" + } + } + } + }, "lolex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/lolex/-/lolex-1.3.2.tgz", @@ -2901,6 +3868,12 @@ "extend": "3.0.2" } }, + "merge-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-2.0.0.tgz", + "integrity": "sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w==", + "dev": true + }, "microbundle": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/microbundle/-/microbundle-0.6.0.tgz", @@ -2983,6 +3956,16 @@ } } }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", @@ -3147,6 +4130,12 @@ "readable-stream": "~1.0.31" } }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, "normalize-range": { "version": "0.1.2", "resolved": "https://registry.npmjs.org/normalize-range/-/normalize-range-0.1.2.tgz", @@ -3551,6 +4540,15 @@ "npm-merge-driver": "^2.3.5" } }, + "npm-run-path": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-4.0.1.tgz", + "integrity": "sha512-S48WzZW777zhNIrn7gxOlISNAqi9ZC/uQFnRdbeIHhZhCA6UqpkOT8T1G7BvfdgP4Er8gF4sUbaS0i7QvIfCWw==", + "dev": true, + "requires": { + "path-key": "^3.0.0" + } + }, "num2fraction": { "version": "1.2.2", "resolved": "https://registry.npmjs.org/num2fraction/-/num2fraction-1.2.2.tgz", @@ -3647,6 +4645,12 @@ "mimic-fn": "^1.0.0" } }, + "opencollective-postinstall": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/opencollective-postinstall/-/opencollective-postinstall-2.0.3.tgz", + "integrity": "sha512-8AV/sCtuzUeTo8gQK5qDZzARrulB3egtLzFgteqB2tcT4Mw7B8Kt7JcDHmltjz6FOAHsvTevk70gZEbhM4ZS9Q==", + "dev": true + }, "optionator": { "version": "0.8.3", "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", @@ -3673,12 +4677,62 @@ "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, + "p-limit": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.3.0.tgz", + "integrity": "sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "dev": true, + "requires": { + "aggregate-error": "^3.0.0" + } + }, "p-queue": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/p-queue/-/p-queue-2.4.2.tgz", "integrity": "sha512-n8/y+yDJwBjoLQe1GSJbbaYQLTI7QHNZI2+rpmCDbe++WLf9HC3gf6iqj5yfPAV71W4UF3ql5W1+UBPXoXTxng==", "dev": true }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "dev": true, + "requires": { + "callsites": "^3.0.0" + }, + "dependencies": { + "callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "dev": true + } + } + }, "parse-json": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", @@ -3688,6 +4742,12 @@ "error-ex": "^1.2.0" } }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, "path-is-absolute": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", @@ -3700,18 +4760,54 @@ "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", "dev": true }, + "path-key": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", + "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": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", "dev": true }, + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + }, + "picomatch": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.2.2.tgz", + "integrity": "sha512-q0M/9eZHzmr0AulXyPwNfZjtwZ/RBZlbN3K3CErVrk50T2ASYI7Bye0EvekFY3IP1Nt2DHu0re+V2ZHIpMkuWg==", + "dev": true + }, "pify": { "version": "4.0.1", "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", "dev": true }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + }, + "please-upgrade-node": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", + "integrity": "sha512-gQR3WpIgNIKwBMVLkpMUeR3e1/E1y42bqDQZfql+kDeXd8COYfM8PQA4X6y7a8u9Ua9FHmsrrmirW2vHs45hWg==", + "dev": true, + "requires": { + "semver-compare": "^1.0.0" + } + }, "pluralize": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/pluralize/-/pluralize-7.0.0.tgz", @@ -4945,6 +6041,12 @@ "integrity": "sha1-1PRWKwzjaW5BrFLQ4ALlemNdxtw=", "dev": true }, + "prettier": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-2.1.2.tgz", + "integrity": "sha512-16c7K+x4qVlJg9rEbXl7HEGmQyZlG4R9AgP+oHKRMsMsuk8s+ATStlf1NpDqyBI1HpVyfjLOeMhH2LvuNvV5Vg==", + "dev": true + }, "pretty-bytes": { "version": "5.3.0", "resolved": "https://registry.npmjs.org/pretty-bytes/-/pretty-bytes-5.3.0.tgz", @@ -4997,6 +6099,16 @@ "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", "dev": true }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, "q": { "version": "1.5.1", "resolved": "https://registry.npmjs.org/q/-/q-1.5.1.tgz", @@ -5469,6 +6581,15 @@ "rx-lite": "*" } }, + "rxjs": { + "version": "6.6.3", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.6.3.tgz", + "integrity": "sha512-trsQc+xYYXZ3urjOiJOuCOa5N3jAZ3eiSpQB5hIT8zGlL2QfnHLJ2r7GMkBGuIausdJN1OneaI6gQlsqNHHmZQ==", + "dev": true, + "requires": { + "tslib": "^1.9.0" + } + }, "sade": { "version": "1.7.0", "resolved": "https://registry.npmjs.org/sade/-/sade-1.7.0.tgz", @@ -5508,6 +6629,18 @@ "integrity": "sha512-sauaDf/PZdVgrLTNYHRtpXa1iRiKcaebiKQ1BJdpQlWH2lCvexQdX55snPFyK7QzpudqbCI0qXFfOasHdyNDGQ==", "dev": true }, + "semver-compare": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/semver-compare/-/semver-compare-1.0.0.tgz", + "integrity": "sha1-De4hahyUGrN+nvsXiPavxf9VN/w=", + "dev": true + }, + "semver-regex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/semver-regex/-/semver-regex-2.0.0.tgz", + "integrity": "sha512-mUdIBBvdn0PLOeP3TEkMH7HHeUP3GjsXCwKarjv/kGmUFOYg1VqEemKhoQpWMu6X2I8kHeuVdGibLGkVK+/5Qw==", + "dev": true + }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", @@ -5604,6 +6737,12 @@ "integrity": "sha1-J5siXfHVgrH1TmWt3UNS4Y+qBxM=", "dev": true }, + "string-argv": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", + "integrity": "sha512-a1uQGz7IyVy9YwhqjZIZu1c8JO8dNIe20xBmSS6qu9kv++k3JGzCVmprbNN5Kn+BgzD5E7YYwg1CcjuJMRNsvg==", + "dev": true + }, "string-hash": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/string-hash/-/string-hash-1.1.3.tgz", @@ -5663,6 +6802,17 @@ "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=", "dev": true }, + "stringify-object": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/stringify-object/-/stringify-object-3.3.0.tgz", + "integrity": "sha512-rHqiFh1elqCQ9WPLIC8I0Q/g/wj5J1eMkyoiD6eoQApWHP0FtlK7rqnhmabL5VUY9JQCcqwwvlOaSuutekgyrw==", + "dev": true, + "requires": { + "get-own-enumerable-property-symbols": "^3.0.0", + "is-obj": "^1.0.1", + "is-regexp": "^1.0.0" + } + }, "strip-ansi": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-3.0.1.tgz", @@ -5672,6 +6822,12 @@ "ansi-regex": "^2.0.0" } }, + "strip-final-newline": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-final-newline/-/strip-final-newline-2.0.0.tgz", + "integrity": "sha512-BrpvfNAE3dcvq7ll3xVumzjKjZQ5tI1sEUIKr3Uoks0XUl45St3FlatVqef9prk4jRDzhW6WZg+3bk93y6pLjA==", + "dev": true + }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -5847,6 +7003,15 @@ "integrity": "sha1-uDVx+k2MJbguIxsG46MFXeTKGkc=", "dev": true }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, "trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", @@ -5874,6 +7039,12 @@ "integrity": "sha1-diIXzAbbJY7EiQihKY6LlRIejqI=", "dev": true }, + "type-fest": { + "version": "0.11.0", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.11.0.tgz", + "integrity": "sha512-OdjXJxnCN1AvyLSzeKIgXTXxV+99ZuXl3Hpo9XpJAv9MBcHrrJOQ5kV7ypXOuQie+AmWG25hLbiKdwYTifzcfQ==", + "dev": true + }, "typedarray": { "version": "0.0.6", "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", @@ -5996,12 +7167,87 @@ "isexe": "^2.0.0" } }, + "which-pm-runs": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/which-pm-runs/-/which-pm-runs-1.0.0.tgz", + "integrity": "sha1-Zws6+8VS4LVd9rd4DKdGFfI60cs=", + "dev": true + }, "word-wrap": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.3.tgz", "integrity": "sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ==", "dev": true }, + "wrap-ansi": { + "version": "6.2.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-6.2.0.tgz", + "integrity": "sha512-r6lPcBGxZXlIcymEu7InxDMhdW0KDxpLgoFLcguasxCaJ/SOIZwINatK9KY/tf+ZrlywOKU0UDj3ATXUBfxJXA==", + "dev": true, + "requires": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", + "dev": true + }, + "ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "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": "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": "sha512-zUz5JD+tgqtuDjMhwIg5uFVV3dtqZ9yQJlZVfq4I01/K5Paj5UHj7VyrQOJvzawSVlKpObApbfD0Ed6yJc+1eg==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.0" + } + }, + "strip-ansi": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", + "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", + "dev": true, + "requires": { + "ansi-regex": "^5.0.0" + } + } + } + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", @@ -6028,6 +7274,12 @@ "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", "dev": true + }, + "yaml": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/yaml/-/yaml-1.10.0.tgz", + "integrity": "sha512-yr2icI4glYaNG+KWONODapy2/jDdMSDnrONSjblABjD9B4Z5LgiircSt8m8sRZFNi08kG9Sm0uSHtEmP3zaEGg==", + "dev": true } } } diff --git a/package.json b/package.json index b7bd5eba..1510df96 100644 --- a/package.json +++ b/package.json @@ -90,15 +90,34 @@ "copyfiles": "^1.2.0", "eslint": "^4.19.1", "eslint-config-developit": "^1.1.1", + "husky": "^4.3.0", + "lint-staged": "^10.4.0", "microbundle": "^0.6.0", "mocha": "^5.2.0", "npm-merge-driver-install": "^1.1.1", "preact": "^10.0.4", + "prettier": "^2.1.2", "sinon": "^1.17.5", "sinon-chai": "^2.8.0", "typescript": "^3.4.1" }, "dependencies": { "pretty-format": "^3.8.0" + }, + "prettier": { + "singleQuote": true, + "trailingComma": "none", + "useTabs": true, + "tabWidth": 2 + }, + "lint-staged": { + "**/*.{js,jsx,ts,tsx,yml}": [ + "prettier --write" + ] + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } } } From 6c6c29a80ce216527e88cb2d760803e4816ffcbd Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Thu, 15 Oct 2020 21:02:08 +0200 Subject: [PATCH 02/13] Apply pettier formatting --- jsx.d.ts | 14 +- package.json | 245 ++++++++++++----------- src/index.d.ts | 16 +- src/index.js | 209 ++++++++++++------- src/jsx.d.ts | 14 +- src/jsx.js | 38 ++-- src/polyfills.js | 5 +- src/util.js | 32 +-- test/context.js | 43 +--- test/index.js | 7 +- test/jsx.js | 118 +++++------ test/pretty.js | 158 +++++++++------ test/render.js | 454 ++++++++++++++++++++++++++++-------------- test/shallowRender.js | 26 ++- 14 files changed, 817 insertions(+), 562 deletions(-) diff --git a/jsx.d.ts b/jsx.d.ts index ee2ba580..98fad555 100644 --- a/jsx.d.ts +++ b/jsx.d.ts @@ -1,13 +1,13 @@ import { VNode } from 'preact'; interface Options { - jsx?: boolean; - xml?: boolean; - functions?: boolean - functionNames?: boolean, - skipFalseAttributes?: boolean - pretty?: boolean | string; + jsx?: boolean; + xml?: boolean; + functions?: boolean; + functionNames?: boolean; + skipFalseAttributes?: boolean; + pretty?: boolean | string; } -export function render(vnode: VNode, context?: any, options?: Options):string; +export function render(vnode: VNode, context?: any, options?: Options): string; export default render; diff --git a/package.json b/package.json index 1510df96..cc0bce5c 100644 --- a/package.json +++ b/package.json @@ -1,123 +1,126 @@ { - "name": "preact-render-to-string", - "amdName": "preactRenderToString", - "version": "5.1.10", - "description": "Render JSX to an HTML string, with support for Preact components.", - "main": "dist/index.js", - "umd:main": "dist/index.js", - "module": "dist/index.module.js", - "jsnext:main": "dist/index.module.js", - "exports": { - ".": { - "require": "./dist/index.js", - "import": "./dist/index.mjs", - "browser": "./dist/index.module.js" - }, - "./jsx": { - "require": "./dist/jsx.js", - "import": "./dist/jsx.mjs", - "browser": "./dist/jsx.module.js" - }, - "./package.json": "./package.json", - "./": "./" - }, - "scripts": { - "build": "npm run -s transpile && npm run -s transpile:jsx && npm run -s copy-typescript-definition", - "postbuild": "node ./config/node-13-exports.js", - "transpile": "microbundle src/index.js -f es,umd --target web --external preact", - "transpile:jsx": "microbundle src/jsx.js -o dist/jsx.js --target web --external none && microbundle dist/jsx.js -o dist/jsx.js -f cjs", - "copy-typescript-definition": "copyfiles -f src/*.d.ts dist", - "test": "eslint src test && tsc && mocha -r babel-core/register test/**/*.js", - "prepublishOnly": "npm run build", - "release": "npm run build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish" - }, - "keywords": [ - "preact", - "render", - "universal", - "isomorphic" - ], - "files": [ - "src", - "dist", - "jsx.js", - "typings.json" - ], - "eslintConfig": { - "extends": "developit", - "rules": { - "react/prefer-stateless-function": 0, - "react/jsx-no-bind": 0, - "react/no-danger": 0, - "jest/valid-expect": 0, - "new-cap": 0 - }, - "settings": { - "react": { - "version": "16.8" - } - } - }, - "babel": { - "presets": [ - "env" - ], - "plugins": [ - [ - "transform-react-jsx", - { - "pragma": "h" - } - ], - "transform-object-rest-spread" - ] - }, - "author": "Jason Miller ", - "license": "MIT", - "typings": "src/index.d.ts", - "repository": "developit/preact-render-to-string", - "bugs": "https://github.com/developit/preact-render-to-string/issues", - "homepage": "https://github.com/developit/preact-render-to-string", - "peerDependencies": { - "preact": ">=10" - }, - "devDependencies": { - "babel-plugin-transform-object-rest-spread": "^6.26.0", - "babel-plugin-transform-react-jsx": "^6.24.1", - "babel-preset-env": "^1.7.0", - "babel-register": "^6.26.0", - "chai": "^3.5.0", - "copyfiles": "^1.2.0", - "eslint": "^4.19.1", - "eslint-config-developit": "^1.1.1", - "husky": "^4.3.0", - "lint-staged": "^10.4.0", - "microbundle": "^0.6.0", - "mocha": "^5.2.0", - "npm-merge-driver-install": "^1.1.1", - "preact": "^10.0.4", - "prettier": "^2.1.2", - "sinon": "^1.17.5", - "sinon-chai": "^2.8.0", - "typescript": "^3.4.1" - }, - "dependencies": { - "pretty-format": "^3.8.0" - }, - "prettier": { - "singleQuote": true, - "trailingComma": "none", - "useTabs": true, - "tabWidth": 2 - }, - "lint-staged": { - "**/*.{js,jsx,ts,tsx,yml}": [ - "prettier --write" - ] - }, - "husky": { - "hooks": { - "pre-commit": "lint-staged" - } - } + "name": "preact-render-to-string", + "amdName": "preactRenderToString", + "version": "5.1.10", + "description": "Render JSX to an HTML string, with support for Preact components.", + "main": "dist/index.js", + "umd:main": "dist/index.js", + "module": "dist/index.module.js", + "jsnext:main": "dist/index.module.js", + "exports": { + ".": { + "require": "./dist/index.js", + "import": "./dist/index.mjs", + "browser": "./dist/index.module.js" + }, + "./jsx": { + "require": "./dist/jsx.js", + "import": "./dist/jsx.mjs", + "browser": "./dist/jsx.module.js" + }, + "./package.json": "./package.json", + "./": "./" + }, + "scripts": { + "build": "npm run -s transpile && npm run -s transpile:jsx && npm run -s copy-typescript-definition", + "postbuild": "node ./config/node-13-exports.js", + "transpile": "microbundle src/index.js -f es,umd --target web --external preact", + "transpile:jsx": "microbundle src/jsx.js -o dist/jsx.js --target web --external none && microbundle dist/jsx.js -o dist/jsx.js -f cjs", + "copy-typescript-definition": "copyfiles -f src/*.d.ts dist", + "test": "eslint src test && tsc && mocha -r babel-core/register test/**/*.js", + "prepublishOnly": "npm run build", + "release": "npm run build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish" + }, + "keywords": [ + "preact", + "render", + "universal", + "isomorphic" + ], + "files": [ + "src", + "dist", + "jsx.js", + "typings.json" + ], + "eslintConfig": { + "extends": "developit", + "rules": { + "react/prefer-stateless-function": 0, + "react/jsx-no-bind": 0, + "react/no-danger": 0, + "jest/valid-expect": 0, + "brace-style": 0, + "new-cap": 0, + "indent": 0 + }, + "settings": { + "react": { + "version": "16.8" + } + } + }, + "babel": { + "presets": [ + "env" + ], + "plugins": [ + [ + "transform-react-jsx", + { + "pragma": "h" + } + ], + "transform-object-rest-spread" + ] + }, + "author": "Jason Miller ", + "license": "MIT", + "typings": "src/index.d.ts", + "repository": "developit/preact-render-to-string", + "bugs": "https://github.com/developit/preact-render-to-string/issues", + "homepage": "https://github.com/developit/preact-render-to-string", + "peerDependencies": { + "preact": ">=10" + }, + "devDependencies": { + "babel-plugin-transform-object-rest-spread": "^6.26.0", + "babel-plugin-transform-react-jsx": "^6.24.1", + "babel-preset-env": "^1.7.0", + "babel-register": "^6.26.0", + "chai": "^3.5.0", + "copyfiles": "^1.2.0", + "eslint": "^4.19.1", + "eslint-config-developit": "^1.1.1", + "husky": "^4.3.0", + "lint-staged": "^10.4.0", + "microbundle": "^0.6.0", + "mocha": "^5.2.0", + "npm-merge-driver-install": "^1.1.1", + "preact": "^10.0.4", + "prettier": "^2.1.2", + "sinon": "^1.17.5", + "sinon-chai": "^2.8.0", + "typescript": "^3.4.1" + }, + "dependencies": { + "pretty-format": "^3.8.0" + }, + "prettier": { + "singleQuote": true, + "trailingComma": "none", + "arrowParens": "avoid", + "useTabs": true, + "tabWidth": 2 + }, + "lint-staged": { + "**/*.{js,jsx,ts,tsx,yml}": [ + "prettier --write" + ] + }, + "husky": { + "hooks": { + "pre-commit": "lint-staged" + } + } } diff --git a/src/index.d.ts b/src/index.d.ts index 89627555..221d349a 100644 --- a/src/index.d.ts +++ b/src/index.d.ts @@ -1,12 +1,16 @@ import { VNode } from 'preact'; interface Options { - shallow?: boolean; - xml?: boolean; - pretty?: boolean | string; + shallow?: boolean; + xml?: boolean; + pretty?: boolean | string; } -export function render(vnode: VNode, context?: any, options?: Options):string; -export function renderToString(vnode: VNode, context?: any, options?: Options):string; -export function shallowRender(vnode: VNode, context?: any):string; +export function render(vnode: VNode, context?: any, options?: Options): string; +export function renderToString( + vnode: VNode, + context?: any, + options?: Options +): string; +export function shallowRender(vnode: VNode, context?: any): string; export default render; diff --git a/src/index.js b/src/index.js index 776c38f9..9d5257c3 100644 --- a/src/index.js +++ b/src/index.js @@ -1,4 +1,11 @@ -import { encodeEntities, indent, isLargeString, styleObjToCss, assign, getChildren } from './util'; +import { + encodeEntities, + indent, + isLargeString, + styleObjToCss, + assign, + getChildren +} from './util'; import { options, Fragment, createElement } from 'preact'; const SHALLOW = { shallow: true }; @@ -10,7 +17,6 @@ const VOID_ELEMENTS = /^(area|base|br|col|embed|hr|img|input|link|meta|param|sou const noop = () => {}; - /** Render Preact JSX + Components to an HTML string. * @name render * @function @@ -24,7 +30,6 @@ const noop = () => {}; */ renderToString.render = renderToString; - /** Only render elements, leaving Components inline as ``. * This method is just a convenience alias for `render(vnode, context, { shallow:true })` * @name shallow @@ -34,10 +39,9 @@ renderToString.render = renderToString; */ let shallowRender = (vnode, context) => renderToString(vnode, context, SHALLOW); - /** The default export is an alias of `render()`. */ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) { - if (vnode==null || typeof vnode==='boolean') { + if (vnode == null || typeof vnode === 'boolean') { return ''; } @@ -53,33 +57,40 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) { opts = opts || {}; let pretty = opts.pretty, - indentChar = pretty && typeof pretty==='string' ? pretty : '\t'; + indentChar = pretty && typeof pretty === 'string' ? pretty : '\t'; // #text nodes - if (typeof vnode!=='object' && !nodeName) { + if (typeof vnode !== 'object' && !nodeName) { return encodeEntities(vnode); } // components - if (typeof nodeName==='function') { + if (typeof nodeName === 'function') { isComponent = true; - if (opts.shallow && (inner || opts.renderRootComponent===false)) { + if (opts.shallow && (inner || opts.renderRootComponent === false)) { nodeName = getComponentName(nodeName); - } - else if (nodeName===Fragment) { + } else if (nodeName === Fragment) { let rendered = ''; let children = []; getChildren(children, vnode.props.children); for (let i = 0; i < children.length; i++) { - rendered += (i > 0 && pretty ? '\n' : '') + renderToString(children[i], context, opts, opts.shallowHighOrder!==false, isSvgMode, selectValue); + rendered += + (i > 0 && pretty ? '\n' : '') + + renderToString( + children[i], + context, + opts, + opts.shallowHighOrder !== false, + isSvgMode, + selectValue + ); } return rendered; - } - else { + } else { let rendered; - let c = vnode.__c = { + let c = (vnode.__c = { __v: vnode, context, props: vnode.props, @@ -88,26 +99,38 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) { forceUpdate: noop, // hooks __h: [] - }; + }); // options.render if (options.__r) options.__r(vnode); - if (!nodeName.prototype || typeof nodeName.prototype.render!=='function') { + if ( + !nodeName.prototype || + typeof nodeName.prototype.render !== 'function' + ) { // Necessary for createContext api. Setting this property will pass // the context value as `this.context` just for this component. let cxType = nodeName.contextType; let provider = cxType && context[cxType.__c]; - let cctx = cxType != null ? (provider ? provider.props.value : cxType.__) : context; + let cctx = + cxType != null + ? provider + ? provider.props.value + : cxType.__ + : context; // stateless functional components rendered = nodeName.call(vnode.__c, props, cctx); - } - else { + } else { // class-based components let cxType = nodeName.contextType; let provider = cxType && context[cxType.__c]; - let cctx = cxType != null ? (provider ? provider.props.value : cxType.__) : context; + let cctx = + cxType != null + ? provider + ? provider.props.value + : cxType.__ + : context; // c = new nodeName(props, context); c = vnode.__c = new nodeName(props, cctx); @@ -115,22 +138,29 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) { // turn off stateful re-rendering: c._dirty = c.__d = true; c.props = props; - if (c.state==null) c.state = {}; + if (c.state == null) c.state = {}; - if (c._nextState==null && c.__s==null) { + if (c._nextState == null && c.__s == null) { c._nextState = c.__s = c.state; } c.context = cctx; - if (nodeName.getDerivedStateFromProps) c.state = assign(assign({}, c.state), nodeName.getDerivedStateFromProps(c.props, c.state)); + if (nodeName.getDerivedStateFromProps) + c.state = assign( + assign({}, c.state), + nodeName.getDerivedStateFromProps(c.props, c.state) + ); else if (c.componentWillMount) { c.componentWillMount(); // If the user called setState in cWM we need to flush pending, // state updates. This is the same behaviour in React. - c.state = c._nextState !== c.state - ? c._nextState : c.__s!==c.state - ? c.__s : c.state; + c.state = + c._nextState !== c.state + ? c._nextState + : c.__s !== c.state + ? c.__s + : c.state; } rendered = c.render(c.props, c.state, c.context); @@ -140,45 +170,61 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) { context = assign(assign({}, context), c.getChildContext()); } - return renderToString(rendered, context, opts, opts.shallowHighOrder!==false, isSvgMode, selectValue); + return renderToString( + rendered, + context, + opts, + opts.shallowHighOrder !== false, + isSvgMode, + selectValue + ); } } // render JSX to HTML - let s = '', propChildren, html; + let s = '', + propChildren, + html; if (props) { let attrs = Object.keys(props); // allow sorting lexicographically for more determinism (useful for tests, such as via preact-jsx-chai) - if (opts && opts.sortAttributes===true) attrs.sort(); + if (opts && opts.sortAttributes === true) attrs.sort(); - for (let i=0; i]/)) continue; - if (!(opts && opts.allAttributes) && (name==='key' || name==='ref' || name==='__self' || name==='__source' || name==='defaultValue')) continue; + if ( + !(opts && opts.allAttributes) && + (name === 'key' || + name === 'ref' || + name === '__self' || + name === '__source' || + name === 'defaultValue') + ) + continue; - if (name==='className') { + if (name === 'className') { if (props.class) continue; name = 'class'; - } - else if (isSvgMode && name.match(/^xlink:?./)) { + } else if (isSvgMode && name.match(/^xlink:?./)) { name = name.toLowerCase().replace(/^xlink:?/, 'xlink:'); } - if (name==='htmlFor') { + if (name === 'htmlFor') { if (props.for) continue; name = 'for'; } - if (name==='style' && v && typeof v==='object') { + if (name === 'style' && v && typeof v === 'object') { v = styleObjToCss(v); } @@ -188,21 +234,21 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) { v = String(v); } - let hooked = opts.attributeHook && opts.attributeHook(name, v, context, opts, isComponent); - if (hooked || hooked==='') { + let hooked = + opts.attributeHook && + opts.attributeHook(name, v, context, opts, isComponent); + if (hooked || hooked === '') { s += hooked; continue; } - if (name==='dangerouslySetInnerHTML') { + if (name === 'dangerouslySetInnerHTML') { html = v && v.__html; - } - else if (nodeName === 'textarea' && name === 'value') { + } else if (nodeName === 'textarea' && name === 'value') { // propChildren = v; - } - else if ((v || v===0 || v==='') && typeof v!=='function') { - if (v===true || v==='') { + } else if ((v || v === 0 || v === '') && typeof v !== 'function') { + if (v === true || v === '') { v = name; // in non-xml mode, allow boolean attributes if (!opts || !opts.xml) { @@ -211,12 +257,11 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) { } } - if (name==='value') { - if (nodeName==='select') { + if (name === 'value') { + if (nodeName === 'select') { selectValue = v; continue; - } - else if (nodeName==='option' && selectValue==v) { + } else if (nodeName === 'option' && selectValue == v) { s += ` selected`; } } @@ -228,14 +273,17 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) { // account for >1 multiline attribute if (pretty) { let sub = s.replace(/^\n\s*/, ' '); - if (sub!==s && !~sub.indexOf('\n')) s = sub; + if (sub !== s && !~sub.indexOf('\n')) s = sub; else if (pretty && ~s.indexOf('\n')) s += '\n'; } s = `<${nodeName}${s}>`; - if (String(nodeName).match(/[\s\n\\/='"\0<>]/)) throw new Error(`${nodeName} is not a valid HTML tag name in ${s}`); + if (String(nodeName).match(/[\s\n\\/='"\0<>]/)) + throw new Error(`${nodeName} is not a valid HTML tag name in ${s}`); - let isVoid = String(nodeName).match(VOID_ELEMENTS) || (opts.voidElements && String(nodeName).match(opts.voidElements)); + let isVoid = + String(nodeName).match(VOID_ELEMENTS) || + (opts.voidElements && String(nodeName).match(opts.voidElements)); if (isVoid) s = s.replace(/>$/, ' />'); let pieces = []; @@ -247,44 +295,56 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) { html = '\n' + indentChar + indent(html, indentChar); } s += html; - } - else if (propChildren != null && getChildren(children = [], propChildren).length) { + } else if ( + propChildren != null && + getChildren((children = []), propChildren).length + ) { let hasLarge = pretty && ~s.indexOf('\n'); let lastWasText = false; - for (let i=0; i 0 && ret[0]!='<'; + let isText = ret.length > 0 && ret[0] != '<'; // We merge adjacent text nodes, otherwise each piece would be printed // on a new line. if (lastWasText && isText) { - pieces[pieces.length -1] += ret; - } - else { + pieces[pieces.length - 1] += ret; + } else { pieces.push(ret); } lastWasText = isText; - } - else { + } else { pieces.push(ret); } } } } if (pretty && hasLarge) { - for (let i=pieces.length; i--; ) { + for (let i = pieces.length; i--; ) { pieces[i] = '\n' + indentChar + indent(pieces[i], indentChar); } } @@ -292,9 +352,8 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) { if (pieces.length) { s += pieces.join(''); - } - else if (opts && opts.xml) { - return s.substring(0, s.length-1) + ' />'; + } else if (opts && opts.xml) { + return s.substring(0, s.length - 1) + ' />'; } if (!isVoid) { @@ -306,7 +365,11 @@ function renderToString(vnode, context, opts, inner, isSvgMode, selectValue) { } function getComponentName(component) { - return component.displayName || component!==Function && component.name || getFallbackComponentName(component); + return ( + component.displayName || + (component !== Function && component.name) || + getFallbackComponentName(component) + ); } function getFallbackComponentName(component) { @@ -315,14 +378,14 @@ function getFallbackComponentName(component) { if (!name) { // search for an existing indexed name for the given component: let index = -1; - for (let i=UNNAMED.length; i--; ) { - if (UNNAMED[i]===component) { + for (let i = UNNAMED.length; i--; ) { + if (UNNAMED[i] === component) { index = i; break; } } // not found, create a new indexed name: - if (index<0) { + if (index < 0) { index = UNNAMED.push(component) - 1; } name = `UnnamedComponent${index}`; diff --git a/src/jsx.d.ts b/src/jsx.d.ts index ee2ba580..98fad555 100644 --- a/src/jsx.d.ts +++ b/src/jsx.d.ts @@ -1,13 +1,13 @@ import { VNode } from 'preact'; interface Options { - jsx?: boolean; - xml?: boolean; - functions?: boolean - functionNames?: boolean, - skipFalseAttributes?: boolean - pretty?: boolean | string; + jsx?: boolean; + xml?: boolean; + functions?: boolean; + functionNames?: boolean; + skipFalseAttributes?: boolean; + pretty?: boolean | string; } -export function render(vnode: VNode, context?: any, options?: Options):string; +export function render(vnode: VNode, context?: any, options?: Options): string; export default render; diff --git a/src/jsx.js b/src/jsx.js index baf45745..f2ac1c78 100644 --- a/src/jsx.js +++ b/src/jsx.js @@ -3,45 +3,53 @@ import renderToString from './index'; import { indent, encodeEntities, assign } from './util'; import prettyFormat from 'pretty-format'; - // we have to patch in Array support, Possible issue in npm.im/pretty-format let preactPlugin = { test(object) { - return object && typeof object==='object' && 'type' in object && 'props' in object && 'key' in object; + return ( + object && + typeof object === 'object' && + 'type' in object && + 'props' in object && + 'key' in object + ); }, print(val, print, indent) { return renderToString(val, preactPlugin.context, preactPlugin.opts, true); } }; - let prettyFormatOpts = { plugins: [preactPlugin] }; - function attributeHook(name, value, context, opts, isComponent) { let type = typeof value; - + // Use render-to-string's built-in handling for these properties - if (name==='dangerouslySetInnerHTML') return false; + if (name === 'dangerouslySetInnerHTML') return false; // always skip null & undefined values, skip false DOM attributes, skip functions if told to - if (value==null || (type==='function' && !opts.functions)) return ''; + if (value == null || (type === 'function' && !opts.functions)) return ''; - if (opts.skipFalseAttributes && !isComponent && (value===false || ((name==='class' || name==='style') && value===''))) return ''; + if ( + opts.skipFalseAttributes && + !isComponent && + (value === false || + ((name === 'class' || name === 'style') && value === '')) + ) + return ''; - let indentChar = typeof opts.pretty==='string' ? opts.pretty : '\t'; - if (type!=='string') { - if (type==='function' && !opts.functionNames) { + let indentChar = typeof opts.pretty === 'string' ? opts.pretty : '\t'; + if (type !== 'string') { + if (type === 'function' && !opts.functionNames) { value = 'Function'; - } - else { + } else { preactPlugin.context = context; preactPlugin.opts = opts; value = prettyFormat(value, prettyFormatOpts); if (~value.indexOf('\n')) { - value = `${indent('\n'+value, indentChar)}\n`; + value = `${indent('\n' + value, indentChar)}\n`; } } return indent(`\n${name}={${value}}`, indentChar); @@ -49,7 +57,6 @@ function attributeHook(name, value, context, opts, isComponent) { return `\n${indentChar}${name}="${encodeEntities(value)}"`; } - let defaultOpts = { attributeHook, jsx: true, @@ -60,7 +67,6 @@ let defaultOpts = { pretty: ' ' }; - function renderToJsxString(vnode, context, opts, inner) { opts = assign(assign({}, defaultOpts), opts || {}); return renderToString(vnode, context, opts, inner); diff --git a/src/polyfills.js b/src/polyfills.js index 5ac2d579..56932791 100644 --- a/src/polyfills.js +++ b/src/polyfills.js @@ -1,6 +1,7 @@ -if (typeof Symbol!=='function') { +if (typeof Symbol !== 'function') { let c = 0; - Symbol = function(s) { // eslint-disable-line + // eslint-disable-next-line + Symbol = function (s) { return `@@${s}${++c}`; }; Symbol.for = s => `@@${s}`; diff --git a/src/util.js b/src/util.js index 51c09441..18db6fb1 100644 --- a/src/util.js +++ b/src/util.js @@ -1,15 +1,20 @@ // DOM properties that should NOT have "px" added when numeric export const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i; -export let encodeEntities = s => String(s) - .replace(/&/g, '&') - .replace(//g, '>') - .replace(/"/g, '"'); +export let encodeEntities = s => + String(s) + .replace(/&/g, '&') + .replace(//g, '>') + .replace(/"/g, '"'); -export let indent = (s, char) => String(s).replace(/(\n+)/g, '$1' + (char || '\t')); +export let indent = (s, char) => + String(s).replace(/(\n+)/g, '$1' + (char || '\t')); -export let isLargeString = (s, length, ignoreLines) => (String(s).length>(length || 40) || (!ignoreLines && String(s).indexOf('\n')!==-1) || String(s).indexOf('<')!==-1); +export let isLargeString = (s, length, ignoreLines) => + String(s).length > (length || 40) || + (!ignoreLines && String(s).indexOf('\n') !== -1) || + String(s).indexOf('<') !== -1; const JS_TO_CSS = {}; @@ -18,13 +23,17 @@ export function styleObjToCss(s) { let str = ''; for (let prop in s) { let val = s[prop]; - if (val!=null) { + if (val != null) { if (str) str += ' '; // str += jsToCss(prop); - str += prop[0]=='-' ? prop : (JS_TO_CSS[prop] || (JS_TO_CSS[prop] = prop.replace(/([A-Z])/g,'-$1').toLowerCase())); + str += + prop[0] == '-' + ? prop + : JS_TO_CSS[prop] || + (JS_TO_CSS[prop] = prop.replace(/([A-Z])/g, '-$1').toLowerCase()); str += ': '; str += val; - if (typeof val==='number' && IS_NON_DIMENSIONAL.test(prop)===false) { + if (typeof val === 'number' && IS_NON_DIMENSIONAL.test(prop) === false) { str += 'px'; } str += ';'; @@ -55,8 +64,7 @@ export function assign(obj, props) { export function getChildren(accumulator, children) { if (Array.isArray(children)) { children.reduce(getChildren, accumulator); - } - else if (children!=null && children!==false) { + } else if (children != null && children !== false) { accumulator.push(children); } return accumulator; diff --git a/test/context.js b/test/context.js index 50cac60c..a52ec812 100644 --- a/test/context.js +++ b/test/context.js @@ -6,7 +6,10 @@ chai.use(sinonChai); // tag to remove leading whitespace from tagged template literal function dedent([str]) { - return str.split( '\n'+str.match(/^\n*(\s+)/)[1] ).join('\n').replace(/(^\n+|\n+\s*$)/g, ''); + return str + .split('\n' + str.match(/^\n*(\s+)/)[1]) + .join('\n') + .replace(/(^\n+|\n+\s*$)/g, ''); } describe('context', () => { @@ -18,11 +21,7 @@ describe('context', () => { class ClassConsumer extends Component { render() { const value = this.context; - return ( -
- value is: {value} -
- ); + return
value is: {value}
; } } ClassConsumer.contextType = Ctx; @@ -42,13 +41,7 @@ describe('context', () => { const { Provider, Consumer } = createContext(); let rendered = renderJsx( - - {(value) => ( -
- value is: {value} -
- )} -
+ {value =>
value is: {value}
}
); @@ -62,13 +55,7 @@ describe('context', () => { let rendered = renderJsx( - - {(value) => ( -
- value is: {value} -
- )} -
+ {value =>
value is: {value}
}
); @@ -82,13 +69,7 @@ describe('context', () => { const { Provider, Consumer } = createContext(); let rendered = renderJsx( - - {(value) => ( -
- value is: {value} -
- )} -
+ {value =>
value is: {value}
}
); @@ -100,13 +81,7 @@ describe('context', () => { it('should support default context value with absent provider', () => { const { Consumer } = createContext('correct'); let rendered = renderJsx( - - {(value) => ( -
- value is: {value} -
- )} -
+ {value =>
value is: {value}
}
); expect(rendered).to.equal(dedent` diff --git a/test/index.js b/test/index.js index 9fd16ced..32fcaf1e 100644 --- a/test/index.js +++ b/test/index.js @@ -1,4 +1,9 @@ -import renderToString, { render, shallowRender, renderToStaticMarkup, renderToString as _renderToString } from '../src'; +import renderToString, { + render, + shallowRender, + renderToStaticMarkup, + renderToString as _renderToString +} from '../src'; import { expect } from 'chai'; describe('render-to-string', () => { diff --git a/test/jsx.js b/test/jsx.js index a1970819..3286fb99 100644 --- a/test/jsx.js +++ b/test/jsx.js @@ -6,7 +6,10 @@ chai.use(sinonChai); // tag to remove leading whitespace from tagged template literal export function dedent([str]) { - return str.split( '\n'+str.match(/^\n*(\s+)/)[1] ).join('\n').replace(/(^\n+|\n+\s*$)/g, ''); + return str + .split('\n' + str.match(/^\n*(\s+)/)[1]) + .join('\n') + .replace(/(^\n+|\n+\s*$)/g, ''); } describe('jsx', () => { @@ -40,37 +43,31 @@ describe('jsx', () => { }); it('should render JSX attributes inline if short enough', () => { - expect(renderJsx( - bar - )).to.equal(dedent` + expect(renderJsx(bar)).to.equal(dedent` bar `); - expect(renderJsx( - bar - )).to.equal(dedent` + expect(renderJsx(bar)).to.equal(dedent` bar `); - expect(renderJsx( - bar - )).to.equal(dedent` + expect(renderJsx(bar)).to.equal(dedent` bar `); - function F(){} - expect(renderJsx( - bar, - { shallow: true, renderRootComponent: false } - )).to.equal(dedent` + function F() {} + expect( + renderJsx(bar, { + shallow: true, + renderRootComponent: false + }) + ).to.equal(dedent` bar `); }); it('should render JSX attributes as multiline if complex', () => { - expect(renderJsx( - bar - )).to.equal(dedent` + expect(renderJsx(bar)).to.equal(dedent` { }); it('should skip null and undefined attributes', () => { - expect(renderJsx( - bar - )).to.equal(`bar`); + expect(renderJsx(bar)).to.equal(`bar`); - expect(renderJsx( - bar - )).to.equal(`bar`); + expect(renderJsx(bar)).to.equal(`bar`); }); it('should render attributes containing VNodes', () => { - expect(renderJsx( - }>bar - )).to.equal(dedent` + expect(renderJsx(}>bar)).to.equal(dedent` }>bar `); - expect(renderJsx( - , - - ]} - >bar - )).to.equal(dedent` + expect(renderJsx(, ]}>bar)).to.equal(dedent` { it('should render empty resolved children identically to no children', () => { const Empty = () => null; const False = () => false; - expect(renderJsx( - - )).to.equal(dedent` + expect( + renderJsx( + + ) + ).to.equal(dedent`
@@ -146,12 +137,14 @@ describe('jsx', () => { }); it('should skip null siblings', () => { - expect(renderJsx( - - - {null} - - )).to.deep.equal(dedent` + expect( + renderJsx( + + + {null} + + ) + ).to.deep.equal(dedent` @@ -159,28 +152,23 @@ describe('jsx', () => { }); it('should skip functions if functions=false', () => { - expect(renderJsx( -
{}} />, - { functions: false } - )).to.equal('
'); + expect( + renderJsx(
{}} />, { functions: false }) + ).to.equal('
'); }); it('should skip function names if functionNames=false', () => { - expect(renderJsx( -
{}} />, - { functionNames: false } - )).to.equal('
'); - - expect(renderJsx( -
, - { functionNames: false } - )).to.equal('
'); + expect( + renderJsx(
{}} />, { functionNames: false }) + ).to.equal('
'); + + expect( + renderJsx(
, { functionNames: false }) + ).to.equal('
'); }); it('should render self-closing elements', () => { - expect(renderJsx( - - )).to.deep.equal(dedent` + expect(renderJsx()).to.deep.equal(dedent` `); }); diff --git a/test/pretty.js b/test/pretty.js index ba85c556..0b5a7306 100644 --- a/test/pretty.js +++ b/test/pretty.js @@ -18,7 +18,9 @@ describe('pretty', () => { ); - expect(rendered).to.equal(`
foobar

hello

`); + expect(rendered).to.equal( + `
foobar

hello

` + ); }); it('should render whitespace when pretty=true', () => { @@ -30,12 +32,14 @@ describe('pretty', () => { ); - expect(rendered).to.equal(`
\n\tfoo\n\tbar\n\t

hello

\n
`); + expect(rendered).to.equal( + `
\n\tfoo\n\tbar\n\t

hello

\n
` + ); }); it('should not indent for short children', () => { let fourty = ''; - for (let i=40; i--; ) fourty += 'x'; + for (let i = 40; i--; ) fourty += 'x'; expect( prettyRender({fourty}), @@ -43,62 +47,79 @@ describe('pretty', () => { ).to.equal(`${fourty}`); expect( - prettyRender({fourty+'a'}), + prettyRender({fourty + 'a'}), '>40 characters' - ).to.equal(`\n\t${fourty+'a'}\n`); + ).to.equal(`\n\t${fourty + 'a'}\n`); }); it('should handle self-closing tags', () => { - expect(prettyRender( -
- hi - - - hi -
- )).to.equal(`
\n\thi\n\t\n\t\n\thi\n
`); + expect( + prettyRender( +
+ hi + + + hi +
+ ) + ).to.equal( + `
\n\thi\n\t\n\t\n\thi\n
` + ); }); it('should support empty tags', () => { - expect(prettyRender( -
- -
- )).to.equal(`
\n\t\n
`); + expect( + prettyRender( +
+ +
+ ) + ).to.equal(`
\n\t\n
`); }); it('should not increase indentation with Fragments', () => { - expect(prettyRender( -
- -
- )).to.equal(`
\n\t\n
`); + expect( + prettyRender( +
+ + + +
+ ) + ).to.equal(`
\n\t\n
`); }); it('should not increase indentation with nested Fragments', () => { - expect(prettyRender( -
- - - -
- )).to.equal(`
\n\t\n
`); + expect( + prettyRender( +
+ + + + + +
+ ) + ).to.equal(`
\n\t\n
`); }); it('should not increase indentation with sibling Fragments', () => { - expect(prettyRender( -
- -
A
-
- -
B
-
-
- )).to.equal(`
\n\t
A
\n\t
B
\n
`); + expect( + prettyRender( +
+ +
A
+
+ +
B
+
+
+ ) + ).to.equal(`
\n\t
A
\n\t
B
\n
`); }); it('should join adjacent text nodes', () => { + // prettier-ignore expect(prettyRender(
hello{' '}
)).to.equal(dedent` @@ -108,6 +129,7 @@ describe('pretty', () => {
`); + // prettier-ignore expect(prettyRender(
hello{' '} {'a'}{'b'}
)).to.equal(dedent` @@ -120,6 +142,7 @@ describe('pretty', () => { }); it('should join adjacent text nodeswith Fragments', () => { + // prettier-ignore expect(prettyRender(
foobar{' '}
)).to.equal(dedent` @@ -131,42 +154,53 @@ describe('pretty', () => { }); it('should collapse whitespace', () => { - expect(prettyRender( -

ab

- )).to.equal(dedent` + expect( + prettyRender( +

+ ab +

+ ) + ).to.equal(dedent`

a b

`); - expect(prettyRender( -

- a{' '} - b -

- )).to.equal(dedent` + expect( + prettyRender( +

+ a b +

+ ) + ).to.equal(dedent`

a b

`); - expect(prettyRender( -

- a{''} - b -

- )).to.equal(dedent` + expect( + prettyRender( +

+ a{''} + b +

+ ) + ).to.equal(dedent`

a b

`); - expect(prettyRender( -

a b

- )).to.equal(dedent` + expect( + prettyRender( +

+ a b +

+ ) + ).to.equal(dedent`

a\ b @@ -177,7 +211,13 @@ describe('pretty', () => { b `); - expect(prettyRender(

a

)).to.equal(dedent` + expect( + prettyRender( +

+ a{' '} +

+ ) + ).to.equal(dedent`

\ a\ diff --git a/test/render.js b/test/render.js index 517b559f..31e062b6 100644 --- a/test/render.js +++ b/test/render.js @@ -18,17 +18,15 @@ describe('render', () => { describe('whitespace', () => { it('should omit whitespace between elements', () => { let children = []; - for (let i=0; i<1000; i++) { - children.push(Math.random()>.5 ? String(i) : h('x-'+String(i), null, i)); + for (let i = 0; i < 1000; i++) { + children.push( + Math.random() > 0.5 ? String(i) : h('x-' + String(i), null, i) + ); } let rendered = render(

- x - a - b - c - {children} - d + xa + bc{children}d
); @@ -39,12 +37,13 @@ describe('render', () => { let rendered = render(
a - b - c + bc
); - expect(rendered).to.equal(`
abc
`); + expect(rendered).to.equal( + `
abc
` + ); }); }); @@ -101,29 +100,35 @@ describe('render', () => { describe('attribute name sanitization', () => { it('should omit attributes with invalid names', () => { - let rendered = render(h('div', { - '': '1', - 'foo"bar': '1', - '"hello"': '1' - })); + let rendered = render( + h('div', { + '': '1', + 'foo"bar': '1', + '"hello"': '1' + }) + ); expect(rendered).to.equal(`
`); }); it('should mitigate attribute name injection', () => { - let rendered = render(h('div', { - '>
': '', - 'foo onclick': 'javascript:alert()', - a: 'b' - })); + let rendered = render( + h('div', { + '>
': '', + 'foo onclick': 'javascript:alert()', + a: 'b' + }) + ); expect(rendered).to.equal(`
`); }); it('should allow emoji attribute names', () => { - let rendered = render(h('div', { - 'a;b': '1', - 'a🧙‍b': '1' - })); + let rendered = render( + h('div', { + 'a;b': '1', + 'a🧙‍b': '1' + }) + ); expect(rendered).to.equal(`
`); }); }); @@ -146,7 +151,7 @@ describe('render', () => { }); it('should omit functions', () => { - let rendered = render(
{}} b={function(){}} />), + let rendered = render(
{}} b={function () {}} />), expected = `
`; expect(rendered).to.equal(expected); @@ -181,28 +186,47 @@ describe('render', () => { }); it('should omit falsey children', () => { - let rendered = render(
{null}|{undefined}|{false}
), + let rendered = render( +
+ {null}|{undefined}|{false} +
+ ), expected = `
||
`; expect(rendered).to.equal(expected); }); it('should self-close void elements', () => { - let rendered = render(
), + let rendered = render( +
+ + +
+ ), expected = `
`; expect(rendered).to.equal(expected); }); it('should self-close custom void elements', () => { - let rendered = render(
, null, { voidElements: /^hello-world$/ }), + let rendered = render( +
+ +
, + null, + { voidElements: /^hello-world$/ } + ), expected = `
`; expect(rendered).to.equal(expected); }); it('does not close void elements with closing tags', () => { - let rendered = render(

Hello World

), + let rendered = render( + +

Hello World

+ + ), expected = `

Hello World

`; expect(rendered).to.equal(expected); @@ -230,7 +254,7 @@ describe('render', () => { }); it('should render SVG elements', () => { - let rendered = render(( + let rendered = render( @@ -240,53 +264,53 @@ describe('render', () => { - )); + ); - expect(rendered).to.equal(`
`); + expect(rendered).to.equal( + `
` + ); }); }); describe('Functional Components', () => { it('should render functional components', () => { - let Test = spy( ({ foo, children }) =>
{ children }
); + let Test = spy(({ foo, children }) =>
{children}
); let rendered = render(content); - expect(rendered) - .to.equal(`
content
`); - - expect(Test) - .to.have.been.calledOnce - .and.calledWithExactly( - match({ - foo: 'test', - children: 'content' - }), - match({}) - ); + expect(rendered).to.equal(`
content
`); + + expect(Test).to.have.been.calledOnce.and.calledWithExactly( + match({ + foo: 'test', + children: 'content' + }), + match({}) + ); }); it('should render functional components within JSX', () => { - let Test = spy( ({ foo, children }) =>
{ children }
); + let Test = spy(({ foo, children }) =>
{children}
); let rendered = render(
- asdf + + asdf +
); - expect(rendered) - .to.equal(`
asdf
`); + expect(rendered).to.equal( + `
asdf
` + ); - expect(Test) - .to.have.been.calledOnce - .and.calledWithExactly( - match({ - foo: 1, - children: match({ type: 'span', props: { children: 'asdf' } }) - }), - match({}) - ); + expect(Test).to.have.been.calledOnce.and.calledWithExactly( + match({ + foo: 1, + children: match({ type: 'span', props: { children: 'asdf' } }) + }), + match({}) + ); }); it('should apply defaultProps', () => { @@ -296,20 +320,30 @@ describe('render', () => { bar: 'default bar' }; - expect(render(), 'defaults').to.equal('
'); - expect(render(), 'partial').to.equal('
'); - expect(render(), 'overridden').to.equal('
'); - expect(render(), 'overridden').to.equal('
'); + expect(render(), 'defaults').to.equal( + '
' + ); + expect(render(), 'partial').to.equal( + '
' + ); + expect(render(), 'overridden').to.equal( + '
' + ); + expect(render(), 'overridden').to.equal( + '
' + ); }); }); describe('Classical Components', () => { it('should render classical components', () => { - let Test = spy(class Test extends Component { - render({ foo, children }, state) { - return
{ children }
; + let Test = spy( + class Test extends Component { + render({ foo, children }, state) { + return
{children}
; + } } - }); + ); spy(Test.prototype, 'render'); let rendered = render(content); @@ -319,52 +353,57 @@ describe('render', () => { children: 'content' }; - expect(rendered) - .to.equal(`
content
`); + expect(rendered).to.equal(`
content
`); - expect(Test) - .to.have.been.calledOnce - .and.calledWith(match(PROPS), match({})); + expect(Test).to.have.been.calledOnce.and.calledWith( + match(PROPS), + match({}) + ); - expect(Test.prototype.render) - .to.have.been.calledOnce - .and.calledWithExactly( - match(PROPS), - match({}), - match({}) // empty context - ); + expect( + Test.prototype.render + ).to.have.been.calledOnce.and.calledWithExactly( + match(PROPS), + match({}), + match({}) // empty context + ); }); it('should render classical components within JSX', () => { - let Test = spy(class Test extends Component { - render({ foo, children }, state) { - return
{ children }
; + let Test = spy( + class Test extends Component { + render({ foo, children }, state) { + return
{children}
; + } } - }); + ); spy(Test.prototype, 'render'); let rendered = render(
- asdf + + asdf +
); - expect(rendered) - .to.equal(`
asdf
`); + expect(rendered).to.equal( + `
asdf
` + ); expect(Test).to.have.been.calledOnce; - expect(Test.prototype.render) - .to.have.been.calledOnce - .and.calledWithExactly( - match({ - foo: 1, - children: match({ type: 'span', props: { children: 'asdf' } }) - }), - match({}), - match({}) - ); + expect( + Test.prototype.render + ).to.have.been.calledOnce.and.calledWithExactly( + match({ + foo: 1, + children: match({ type: 'span', props: { children: 'asdf' } }) + }), + match({}), + match({}) + ); }); it('should apply defaultProps', () => { @@ -378,10 +417,18 @@ describe('render', () => { bar: 'default bar' }; - expect(render(), 'defaults').to.equal('
'); - expect(render(), 'partial').to.equal('
'); - expect(render(), 'overridden').to.equal('
'); - expect(render(), 'overridden').to.equal('
'); + expect(render(), 'defaults').to.equal( + '
' + ); + expect(render(), 'partial').to.equal( + '
' + ); + expect(render(), 'overridden').to.equal( + '
' + ); + expect(render(), 'overridden').to.equal( + '
' + ); }); it('should initialize state as an empty object', () => { @@ -411,9 +458,11 @@ describe('render', () => { const result = render(); - expect(Test.prototype.constructor.getDerivedStateFromProps) - .to.have.been.calledOnce - .and.to.have.been.calledBefore(Test.prototype.render); + expect( + Test.prototype.constructor.getDerivedStateFromProps + ).to.have.been.calledOnce.and.to.have.been.calledBefore( + Test.prototype.render + ); expect(result).to.equal('
'); }); @@ -430,9 +479,11 @@ describe('render', () => { render(); - expect(Test.prototype.componentWillMount) - .to.have.been.calledOnce - .and.to.have.been.calledBefore(Test.prototype.render); + expect( + Test.prototype.componentWillMount + ).to.have.been.calledOnce.and.to.have.been.calledBefore( + Test.prototype.render + ); }); it('should be able to call setState in componentWillMount', () => { @@ -445,11 +496,7 @@ describe('render', () => { this.setState({ updated: true }); } render() { - return ( -

- {this.state.updated.toString()} -

- ); + return

{this.state.updated.toString()}

; } } @@ -470,11 +517,12 @@ describe('render', () => { render(); - expect(Test.prototype.constructor.getDerivedStateFromProps) - .to.have.been.calledOnce - .and.to.have.been.calledBefore(Test.prototype.render); - expect(Test.prototype.componentWillMount) - .to.not.have.been.called; + expect( + Test.prototype.constructor.getDerivedStateFromProps + ).to.have.been.calledOnce.and.to.have.been.calledBefore( + Test.prototype.render + ); + expect(Test.prototype.componentWillMount).to.not.have.been.called; }); it('should pass context to grandchildren', () => { @@ -486,14 +534,18 @@ describe('render', () => { return CONTEXT; } render(props) { - return
; + return ( +
+ +
+ ); } } spy(Outer.prototype, 'getChildContext'); class Inner extends Component { render(props, state, context) { - return
{ context && context.a }
; + return
{context && context.a}
; } } spy(Inner.prototype, 'render'); @@ -501,13 +553,21 @@ describe('render', () => { render(); expect(Outer.prototype.getChildContext).to.have.been.calledOnce; - expect(Inner.prototype.render).to.have.been.calledWith(match({}), match({}), CONTEXT); + expect(Inner.prototype.render).to.have.been.calledWith( + match({}), + match({}), + CONTEXT + ); CONTEXT.foo = 'bar'; render(); expect(Outer.prototype.getChildContext).to.have.been.calledTwice; - expect(Inner.prototype.render).to.have.been.calledWith(match(PROPS), match({}), CONTEXT); + expect(Inner.prototype.render).to.have.been.calledWith( + match(PROPS), + match({}), + CONTEXT + ); }); it('should pass context to direct children', () => { @@ -526,7 +586,7 @@ describe('render', () => { class Inner extends Component { render(props, state, context) { - return
{ context && context.a }
; + return
{context && context.a}
; } } spy(Inner.prototype, 'render'); @@ -534,16 +594,26 @@ describe('render', () => { render(); expect(Outer.prototype.getChildContext).to.have.been.calledOnce; - expect(Inner.prototype.render).to.have.been.calledWith(match({}), match({}), CONTEXT); + expect(Inner.prototype.render).to.have.been.calledWith( + match({}), + match({}), + CONTEXT + ); CONTEXT.foo = 'bar'; render(); expect(Outer.prototype.getChildContext).to.have.been.calledTwice; - expect(Inner.prototype.render).to.have.been.calledWith(match(PROPS), match({}), CONTEXT); + expect(Inner.prototype.render).to.have.been.calledWith( + match(PROPS), + match({}), + CONTEXT + ); // make sure render() could make use of context.a - expect(Inner.prototype.render).to.have.returned(match({ props: { children: 'a' } })); + expect(Inner.prototype.render).to.have.returned( + match({ props: { children: 'a' } }) + ); }); it('should preserve existing context properties when creating child contexts', () => { @@ -554,7 +624,11 @@ describe('render', () => { return { outerContext }; } render() { - return
; + return ( +
+ +
+ ); } } @@ -578,39 +652,77 @@ describe('render', () => { render(); - expect(Inner.prototype.render).to.have.been.calledWith(match({}), match({}), { outerContext }); - expect(InnerMost.prototype.render).to.have.been.calledWith(match({}), match({}), { outerContext, innerContext }); + expect(Inner.prototype.render).to.have.been.calledWith( + match({}), + match({}), + { outerContext } + ); + expect(InnerMost.prototype.render).to.have.been.calledWith( + match({}), + match({}), + { outerContext, innerContext } + ); }); }); describe('High-order components', () => { class Outer extends Component { render({ children, ...props }) { - return child { children }; + return ( + + child {children} + + ); } } class Inner extends Component { render({ children, ...props }) { - return
{ children }
; + return ( +
+ {children} +
+ ); } } it('should resolve+render high order components', () => { - let rendered = render(foo); - expect(rendered).to.equal('
child foo
'); + let rendered = render( + + foo + + ); + expect(rendered).to.equal( + '
child foo
' + ); }); it('should render child inline when shallow=true', () => { - let rendered = shallowRender(foo); - expect(rendered).to.equal('child foo'); + let rendered = shallowRender( + + foo + + ); + expect(rendered).to.equal( + 'child foo' + ); }); it('should render nested high order components when shallowHighOrder=false', () => { // using functions for meaningful generation of displayName - function Outer() { return ; } - function Middle() { return
; } - function Inner() { return 'hi'; } + function Outer() { + return ; + } + function Middle() { + return ( +
+ +
+ ); + } + function Inner() { + return 'hi'; + } let rendered = render(); expect(rendered).to.equal('
hi
'); @@ -618,8 +730,14 @@ describe('render', () => { rendered = render(, null, { shallow: true }); expect(rendered, '{shallow:true}').to.equal(''); - rendered = render(, null, { shallow: true, shallowHighOrder: false }); - expect(rendered, '{shallow:true,shallowHighOrder:false}').to.equal('
', 'but it should never render nested grandchild components'); + rendered = render(, null, { + shallow: true, + shallowHighOrder: false + }); + expect(rendered, '{shallow:true,shallowHighOrder:false}').to.equal( + '
', + 'but it should never render nested grandchild components' + ); }); }); @@ -627,12 +745,18 @@ describe('render', () => { it('should support dangerouslySetInnerHTML', () => { // some invalid HTML to make sure we're being flakey: let html = 'asdf some text
  • foo
  • bar
'; - let rendered = render(
); + let rendered = render( +
+ ); expect(rendered).to.equal(`
${html}
`); }); it('should override children', () => { - let rendered = render(
bar
); + let rendered = render( +
+ bar +
+ ); expect(rendered).to.equal('
foo
'); }); }); @@ -678,7 +802,9 @@ describe('render', () => { }); it('should sort attributes lexicographically if enabled', () => { - let rendered = render(
, null, { sortAttributes: true }); + let rendered = render(
, null, { + sortAttributes: true + }); expect(rendered).to.equal('
'); }); }); @@ -693,11 +819,15 @@ describe('render', () => { }); it('should render boolean attributes with named values', () => { - expect(renderXml(
)).to.equal(`
`); + expect(renderXml(
)).to.equal( + `
` + ); }); it('should exclude falsey attributes', () => { - expect(renderXml(
)).to.equal(`
`); + expect(renderXml(
)).to.equal( + `
` + ); }); }); @@ -742,7 +872,11 @@ describe('render', () => { describe('Fragments', () => { it('should skip Fragment node', () => { - let html = render(
foo
); + let html = render( +
+ foo +
+ ); expect(html).to.equal('
foo
'); }); @@ -781,9 +915,13 @@ describe('render', () => {
quux
-
, undefined, { pretty: true } +
, + undefined, + { pretty: true } + ); + expect(html).to.equal( + '
\n\t
foo
\n\t
bar
\n\t
\n\t\t
baz
\n\t\t
quux
\n\t
\n
' ); - expect(html).to.equal('
\n\t
foo
\n\t
bar
\n\t
\n\t\t
baz
\n\t\t
quux
\n\t
\n
'); }); it('should skip Fragment even if it has props', () => { @@ -825,7 +963,7 @@ describe('render', () => { } // eslint-disable-next-line prefer-arrow-callback - expect(function() { + expect(function () { render(); }).to.not.throw(); }); @@ -844,7 +982,7 @@ describe('render', () => { } // eslint-disable-next-line prefer-arrow-callback - expect(function() { + expect(function () { render(); }).to.not.throw(); }); @@ -906,7 +1044,7 @@ describe('render', () => { it('should not trigger useEffect callbacks', () => { let called = false; function Foo() { - useEffect(() => called = true); + useEffect(() => (called = true)); return
; } @@ -922,7 +1060,9 @@ describe('render', () => { ); - expect(res).to.equal(''); + expect(res).to.equal( + '' + ); }); it('should render select value on option with a Fragment', () => { @@ -934,7 +1074,9 @@ describe('render', () => { ); - expect(res).to.equal(''); + expect(res).to.equal( + '' + ); }); it('should render select value on option through a component', () => { @@ -951,7 +1093,9 @@ describe('render', () => { ); - expect(res).to.equal(''); + expect(res).to.equal( + '' + ); }); it('should render select value with loose equality', () => { @@ -960,6 +1104,8 @@ describe('render', () => { ); - expect(res).to.equal(''); + expect(res).to.equal( + '' + ); }); }); diff --git a/test/shallowRender.js b/test/shallowRender.js index 0b67fb75..7f598b41 100644 --- a/test/shallowRender.js +++ b/test/shallowRender.js @@ -7,21 +7,35 @@ chai.use(sinonChai); describe('shallowRender()', () => { it('should not render nested components', () => { - let Test = spy( ({ foo, children }) =>
test child{ children }
); + let Test = spy(({ foo, children }) => ( +
+ test child + {children} +
+ )); Test.displayName = 'Test'; let rendered = shallowRender(
- asdf + + asdf +
); - expect(rendered).to.equal(`
asdf
`); + expect(rendered).to.equal( + `
asdf
` + ); expect(Test).not.to.have.been.called; }); it('should always render root component', () => { - let Test = spy( ({ foo, children }) =>
test child{ children }
); + let Test = spy(({ foo, children }) => ( +
+ test child + {children} +
+ )); Test.displayName = 'Test'; let rendered = shallowRender( @@ -30,7 +44,9 @@ describe('shallowRender()', () => { ); - expect(rendered).to.equal(`
test childasdf
`); + expect(rendered).to.equal( + `
test childasdf
` + ); expect(Test).to.have.been.calledOnce; }); From 3e0e6d675825ca3fb3a36a889a446e22acd71d3a Mon Sep 17 00:00:00 2001 From: Marvin Hagemeister Date: Thu, 15 Oct 2020 21:33:32 +0200 Subject: [PATCH 03/13] Add simple benchmarks --- benchmarks/index.js | 14 ++++++++++++++ benchmarks/stack.js | 31 ++++++++++++++++++++++++++++++ benchmarks/text.js | 46 +++++++++++++++++++++++++++++++++++++++++++++ package-lock.json | 39 ++++++++++++++++++++++++++++++++++++++ package.json | 5 ++++- 5 files changed, 134 insertions(+), 1 deletion(-) create mode 100644 benchmarks/index.js create mode 100644 benchmarks/stack.js create mode 100644 benchmarks/text.js diff --git a/benchmarks/index.js b/benchmarks/index.js new file mode 100644 index 00000000..076b8108 --- /dev/null +++ b/benchmarks/index.js @@ -0,0 +1,14 @@ +import { h } from 'preact'; +import Suite from 'benchmarkjs-pretty'; +import renderToString from '../src/index'; +import TextApp from './text'; +import StackApp from './stack'; + +new Suite('Bench') + .add('Text', () => { + return renderToString(); + }) + .add('Stack Depth', () => { + return renderToString(); + }) + .run(); diff --git a/benchmarks/stack.js b/benchmarks/stack.js new file mode 100644 index 00000000..0c13b490 --- /dev/null +++ b/benchmarks/stack.js @@ -0,0 +1,31 @@ +import { h } from 'preact'; + +function Leaf() { + return ( +
+ + deep stack + +
+ ); +} + +function PassThrough(props) { + return
{props.children}
; +} + +function recursive(n) { + if (n <= 0) { + return ; + } + return {recursive(n - 1)}; +} + +const content = []; +for (let i = 0; i < 10; i++) { + content.push(recursive(1000)); +} + +export default function App() { + return
{content}
; +} diff --git a/benchmarks/text.js b/benchmarks/text.js new file mode 100644 index 00000000..757b6953 --- /dev/null +++ b/benchmarks/text.js @@ -0,0 +1,46 @@ +import { h } from 'preact'; + +function Bavaria() { + return ( +
+ + Bavaria ipsum dolor sit amet gwiss Charivari Auffisteign koa. Umma + pfenningguat vui huift vui back mas Landla Bradwurschtsemmal, + Fingahaggln. Wolpern ja, wo samma denn wea nia ausgähd, kummt nia hoam + baddscher i moan oiwei! Kloan pfenningguat is Charivari Bussal, + hallelujah sog i, luja. Liberalitas Bavariae hod Schorsch om auf’n Gipfe + gwiss naa. Und ja, wo samma denn Ohrwaschl hoggd auffi Spotzerl + Diandldrahn, oba? Is sog i und glei wirds no fui lustiga Biaschlegl ma + nimma ned woar gscheckate, pfenningguat! Gstanzl dei Schorsch Radi i mog + di fei hea Reiwadatschi fensdaln dei glei a Hoiwe. Bitt umananda ghupft + wia gsprunga Gschicht kimmt, oamoi obandeln. Sog i helfgod amoi + hallelujah sog i, luja i hob di narrisch gean, Brodzeid. Wolln a Maß und + no a Maß Gaudi obandln eana boarischer hallelujah sog i, luja Maßkruag + greaßt eich nachad, Schmankal. + + + Dei um Godds wujn naa Watschnbaam Obazda Trachtnhuat, Vergeltsgott + Schneid Schbozal. Om auf’n Gipfe Ramasuri um Godds wujn eana. Wos + sammawiedaguad sei Weißwiaschd da, hog di hi is des liab des umananda + Brezn Sauakraud Diandldrahn. Vo de weida pfundig Kirwa de Sonn + Hetschapfah Watschnpladdla auf gehds beim Schichtl Meidromml auffi lem + und lem lossn! Watschnpladdla wolln measi obandeln griasd eich midnand + Oachkatzlschwoaf is ma Wuascht sammawiedaguad aasgem. A so a Schmarn + Weibaleid naa, des basd scho. Abfieseln helfgod Sauwedda middn ded + schoo. A bissal wos gehd ollaweil Sauwedda is Servas wiavui wo hi o’ha, + a liabs Deandl pfiad de nix. Maßkruag etza so spernzaln. Weiznglasl + Bradwurschtsemmal da, Schdeckalfisch: Mei Musi bitt des wiad a + Mordsgaudi kumm geh Biakriagal Greichats obacht? + +
+ ); +} + +const content = []; +for (let i = 0; i < 1000; i++) { + content.push(); +} + +export default function App() { + return
{content}
; +} diff --git a/package-lock.json b/package-lock.json index f649d938..c6b0de0d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -214,6 +214,12 @@ } } }, + "@types/benchmark": { + "version": "1.0.33", + "resolved": "https://registry.npmjs.org/@types/benchmark/-/benchmark-1.0.33.tgz", + "integrity": "sha512-rG7Ieasa9UfZJnL72qiFvY9ivhEIYjCGgfcLLb5tJ/EL9+Mcxernj6W3HVCv/cOfJYuwNUwvVVhnrKl8iT8aqA==", + "dev": true + }, "@types/estree": { "version": "0.0.39", "resolved": "https://registry.npmjs.org/@types/estree/-/estree-0.0.39.tgz", @@ -1099,6 +1105,27 @@ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, + "benchmark": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", + "integrity": "sha1-CfPeMckWQl1JjMLuVloOvzwqVik=", + "dev": true, + "requires": { + "lodash": "^4.17.4", + "platform": "^1.3.3" + } + }, + "benchmarkjs-pretty": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/benchmarkjs-pretty/-/benchmarkjs-pretty-2.0.1.tgz", + "integrity": "sha512-kQrGxZ+R64lT2Rfr7H3gW7OhBPWJ9+H0X6O0zZzOV3/O8PUGfrmpyXRXpEBJFWm+BFY8qhSA9aU7PppyeH4f4A==", + "dev": true, + "requires": { + "@types/benchmark": "^1.0.33", + "benchmark": "^2.1.4", + "kolorist": "^1.2.6" + } + }, "big.js": { "version": "5.2.2", "resolved": "https://registry.npmjs.org/big.js/-/big.js-5.2.2.tgz", @@ -3250,6 +3277,12 @@ "object.assign": "^4.1.0" } }, + "kolorist": { + "version": "1.2.7", + "resolved": "https://registry.npmjs.org/kolorist/-/kolorist-1.2.7.tgz", + "integrity": "sha512-OuFA1+AkZveh3t0vti3zyMj0Vfk4mhwJcNcHcZ/y1TDYiZc+Ik3RY3kSLWAzxB0ns6eTZk65I42QYvVuqZF7iQ==", + "dev": true + }, "levn": { "version": "0.3.0", "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", @@ -4799,6 +4832,12 @@ "find-up": "^4.0.0" } }, + "platform": { + "version": "1.3.6", + "resolved": "https://registry.npmjs.org/platform/-/platform-1.3.6.tgz", + "integrity": "sha512-fnWVljUchTro6RiCFvCXBbNhJc2NijN7oIQxbwsyL0buWJPG85v81ehlHI9fXrJsMNgTofEoWIQeClKpgxFLrg==", + "dev": true + }, "please-upgrade-node": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/please-upgrade-node/-/please-upgrade-node-3.2.0.tgz", diff --git a/package.json b/package.json index cc0bce5c..129fd17c 100644 --- a/package.json +++ b/package.json @@ -28,6 +28,7 @@ "transpile:jsx": "microbundle src/jsx.js -o dist/jsx.js --target web --external none && microbundle dist/jsx.js -o dist/jsx.js -f cjs", "copy-typescript-definition": "copyfiles -f src/*.d.ts dist", "test": "eslint src test && tsc && mocha -r babel-core/register test/**/*.js", + "bench": "node -r babel-core/register benchmarks/index.js", "prepublishOnly": "npm run build", "release": "npm run build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish" }, @@ -52,7 +53,8 @@ "jest/valid-expect": 0, "brace-style": 0, "new-cap": 0, - "indent": 0 + "indent": 0, + "arrow-body-style": 0 }, "settings": { "react": { @@ -88,6 +90,7 @@ "babel-plugin-transform-react-jsx": "^6.24.1", "babel-preset-env": "^1.7.0", "babel-register": "^6.26.0", + "benchmarkjs-pretty": "^2.0.1", "chai": "^3.5.0", "copyfiles": "^1.2.0", "eslint": "^4.19.1", From de4f5e3a6876ffc1df6424bed78e713fdfeb5468 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Tue, 9 Feb 2021 17:50:40 -0500 Subject: [PATCH 04/13] incorporate marvin's benchmarks --- .gitignore | 1 + benchmarks/index.js | 14 - package-lock.json | 1414 +++++++++++++++++- package.json | 25 +- {benchmarks => test/bench/fixtures}/stack.js | 0 {benchmarks => test/bench/fixtures}/text.js | 0 6 files changed, 1419 insertions(+), 35 deletions(-) delete mode 100644 benchmarks/index.js rename {benchmarks => test/bench/fixtures}/stack.js (100%) rename {benchmarks => test/bench/fixtures}/text.js (100%) diff --git a/.gitignore b/.gitignore index d5315e30..fd011f1c 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ /npm-debug.log .DS_Store /src/preact-render-to-string-tests.d.ts +test/bench/.dist.modern.js \ No newline at end of file diff --git a/benchmarks/index.js b/benchmarks/index.js deleted file mode 100644 index 076b8108..00000000 --- a/benchmarks/index.js +++ /dev/null @@ -1,14 +0,0 @@ -import { h } from 'preact'; -import Suite from 'benchmarkjs-pretty'; -import renderToString from '../src/index'; -import TextApp from './text'; -import StackApp from './stack'; - -new Suite('Bench') - .add('Text', () => { - return renderToString(); - }) - .add('Stack Depth', () => { - return renderToString(); - }) - .run(); diff --git a/package-lock.json b/package-lock.json index b23fb4ab..a2233d60 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,6 +4,38 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/cli": { + "version": "7.12.13", + "resolved": "https://registry.npmjs.org/@babel/cli/-/cli-7.12.13.tgz", + "integrity": "sha512-Zto3HPeE0GRmaxobUl7NvFTo97NKe1zdAuWqTO8oka7nE0IIqZ4CFvuRZe1qf+ZMd7eHMhwqrecjwc10mjXo/g==", + "dev": true, + "requires": { + "@nicolo-ribaudo/chokidar-2": "2.1.8-no-fsevents", + "chokidar": "^3.4.0", + "commander": "^4.0.1", + "convert-source-map": "^1.1.0", + "fs-readdir-recursive": "^1.1.0", + "glob": "^7.0.0", + "lodash": "^4.17.19", + "make-dir": "^2.1.0", + "slash": "^2.0.0", + "source-map": "^0.5.0" + }, + "dependencies": { + "commander": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/commander/-/commander-4.1.1.tgz", + "integrity": "sha512-NOKm8xhkzAjzFx8B2v5OAHT+u5pRQc2UCa2Vq9jYL/31o2wi9mxBA7LIFs3sV5VSC49z6pEhfbMULvShKj26WA==", + "dev": true + }, + "lodash": { + "version": "4.17.20", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", + "integrity": "sha512-PlhdFcillOINfeV7Ni6oF1TAEayyZBoZ8bcshTHqOYJYlrqzRK5hagpagky5o4HfCzzd1TRkXPMFq6cKk9rGmA==", + "dev": true + } + } + }, "@babel/code-frame": { "version": "7.12.13", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.12.13.tgz", @@ -42,24 +74,6 @@ "source-map": "^0.5.0" }, "dependencies": { - "debug": { - "version": "4.3.1", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", - "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", - "dev": true, - "requires": { - "ms": "2.1.2" - } - }, - "json5": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", - "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", - "dev": true, - "requires": { - "minimist": "^1.2.5" - } - }, "lodash": { "version": "4.17.20", "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.20.tgz", @@ -1282,6 +1296,247 @@ "extend": "3.0.2" } }, + "@nicolo-ribaudo/chokidar-2": { + "version": "2.1.8-no-fsevents", + "resolved": "https://registry.npmjs.org/@nicolo-ribaudo/chokidar-2/-/chokidar-2-2.1.8-no-fsevents.tgz", + "integrity": "sha512-+nb9vWloHNNMFHjGofEam3wopE3m1yuambrrd/fnPc+lFOMB9ROTqQlche9ByFWNkdNqfSgR/kkQtQ8DzEWt2w==", + "dev": true, + "optional": true, + "requires": { + "anymatch": "^2.0.0", + "async-each": "^1.0.1", + "braces": "^2.3.2", + "glob-parent": "^3.1.0", + "inherits": "^2.0.3", + "is-binary-path": "^1.0.0", + "is-glob": "^4.0.0", + "normalize-path": "^3.0.0", + "path-is-absolute": "^1.0.0", + "readdirp": "^2.2.1", + "upath": "^1.1.1" + }, + "dependencies": { + "anymatch": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-2.0.0.tgz", + "integrity": "sha512-5teOsQWABXHHBFP9y3skS5P3d/WfWXpv3FUpy+LorMrNYaT9pI4oLMQX7jzQ2KklNpGpWHzdCXTDT2Y3XGlZBw==", + "dev": true, + "optional": true, + "requires": { + "micromatch": "^3.1.4", + "normalize-path": "^2.1.1" + }, + "dependencies": { + "normalize-path": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-2.1.1.tgz", + "integrity": "sha1-GrKLVW4Zg2Oowab35vogE3/mrtk=", + "dev": true, + "optional": true, + "requires": { + "remove-trailing-separator": "^1.0.1" + } + } + } + }, + "binary-extensions": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-1.13.1.tgz", + "integrity": "sha512-Un7MIEDdUC5gNpcGDV97op1Ywk748MpHcFTHoYs6qnj1Z3j7I53VG3nwZhKzoBZmbdRNnb6WRdFlwl7tSDuZGw==", + "dev": true, + "optional": true + }, + "braces": { + "version": "2.3.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-2.3.2.tgz", + "integrity": "sha512-aNdbnj9P8PjdXU4ybaWLK2IF3jc/EoDYbC7AazW6to3TRsfXxscC9UXOB5iDiEQrkyIbWp2SLQda4+QAa7nc3w==", + "dev": true, + "optional": true, + "requires": { + "arr-flatten": "^1.1.0", + "array-unique": "^0.3.2", + "extend-shallow": "^2.0.1", + "fill-range": "^4.0.0", + "isobject": "^3.0.1", + "repeat-element": "^1.1.2", + "snapdragon": "^0.8.1", + "snapdragon-node": "^2.0.1", + "split-string": "^3.0.2", + "to-regex": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "fill-range": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-4.0.0.tgz", + "integrity": "sha1-1USBHUKPmOsGpj3EAtJAPDKMOPc=", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-number": "^3.0.0", + "repeat-string": "^1.6.1", + "to-regex-range": "^2.1.0" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, + "glob-parent": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-3.1.0.tgz", + "integrity": "sha1-nmr2KZ2NO9K9QEMIMr0RPfkGxa4=", + "dev": true, + "optional": true, + "requires": { + "is-glob": "^3.1.0", + "path-dirname": "^1.0.0" + }, + "dependencies": { + "is-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-3.1.0.tgz", + "integrity": "sha1-e6WuJCF4BKxwcHuWkiVnSGzD6Eo=", + "dev": true, + "optional": true, + "requires": { + "is-extglob": "^2.1.0" + } + } + } + }, + "is-binary-path": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-1.0.1.tgz", + "integrity": "sha1-dfFmQrSA8YenEcgUFh/TpKdlWJg=", + "dev": true, + "optional": true, + "requires": { + "binary-extensions": "^1.0.0" + } + }, + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true, + "optional": true + }, + "micromatch": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-3.1.10.tgz", + "integrity": "sha512-MWikgl9n9M3w+bpsY3He8L+w9eF9338xRl8IAO5viDizwSzziFEyUzo2xrrloB64ADbTf8uA8vRqqttDTOmccg==", + "dev": true, + "optional": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "braces": "^2.3.1", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "extglob": "^2.0.4", + "fragment-cache": "^0.2.1", + "kind-of": "^6.0.2", + "nanomatch": "^1.2.9", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.2" + } + }, + "readable-stream": { + "version": "2.3.7", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.7.tgz", + "integrity": "sha512-Ebho8K4jIbHAxnuxi7o42OrZgF/ZTNcsZj6nRKyUmkhLFq8CHItp/fy6hQZuZmP/n3yZ9VBUbp4zz/mX8hmYPw==", + "dev": true, + "optional": true, + "requires": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "readdirp": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-2.2.1.tgz", + "integrity": "sha512-1JU/8q+VgFZyxwrJ+SVIOsh+KywWGpds3NTqikiKpDMZWScmAYyKIgqkO+ARvNWJfXeXR1zxz7aHF4u4CyH6vQ==", + "dev": true, + "optional": true, + "requires": { + "graceful-fs": "^4.1.11", + "micromatch": "^3.1.10", + "readable-stream": "^2.0.2" + } + }, + "string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "dev": true, + "optional": true, + "requires": { + "safe-buffer": "~5.1.0" + } + }, + "to-regex-range": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-2.1.1.tgz", + "integrity": "sha1-fIDBe53+vlmeJzZ+DU3VWQFB2zg=", + "dev": true, + "optional": true, + "requires": { + "is-number": "^3.0.0", + "repeat-string": "^1.6.1" + } + } + } + }, "@rollup/plugin-alias": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/@rollup/plugin-alias/-/plugin-alias-3.1.2.tgz", @@ -1602,6 +1857,27 @@ "sprintf-js": "~1.0.2" } }, + "arr-diff": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", + "integrity": "sha1-1kYQdP6/7HHn4VI1dhoyml3HxSA=", + "dev": true, + "optional": true + }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true, + "optional": true + }, + "arr-union": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/arr-union/-/arr-union-3.1.0.tgz", + "integrity": "sha1-45sJrqne+Gao8gbiiK9jkZuuOcQ=", + "dev": true, + "optional": true + }, "array-includes": { "version": "3.1.2", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.1.2.tgz", @@ -1615,6 +1891,13 @@ "is-string": "^1.0.5" } }, + "array-unique": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/array-unique/-/array-unique-0.3.2.tgz", + "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", + "dev": true, + "optional": true + }, "array.prototype.flatmap": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/array.prototype.flatmap/-/array.prototype.flatmap-1.2.4.tgz", @@ -1633,6 +1916,13 @@ "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", "dev": true }, + "assign-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assign-symbols/-/assign-symbols-1.0.0.tgz", + "integrity": "sha1-WWZ/QfrdTyDMvCu5a41Pf3jsA2c=", + "dev": true, + "optional": true + }, "ast-metadata-inferer": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/ast-metadata-inferer/-/ast-metadata-inferer-0.4.0.tgz", @@ -1645,12 +1935,26 @@ "integrity": "sha512-Z7tMw1ytTXt5jqMcOP+OQteU1VuNK9Y02uuJtKQ1Sv69jXQKKg5cibLwGJow8yzZP+eAc18EmLGPal0bp36rvQ==", "dev": true }, + "async-each": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/async-each/-/async-each-1.0.3.tgz", + "integrity": "sha512-z/WhQ5FPySLdvREByI2vZiTWwCnF0moMJ1hK9YQwDTHKh6I7/uSckMetoRGb5UBZPC1z0jlw+n/XCgjeH7y1AQ==", + "dev": true, + "optional": true + }, "asyncro": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/asyncro/-/asyncro-3.0.0.tgz", "integrity": "sha512-nEnWYfrBmA3taTiuiOoZYmgJ/CNrSoQLeLs29SeLcPu60yaw/mHDBHV0iOZ051fTvsTHxpCY+gXibqT9wbQYfg==", "dev": true }, + "atob": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/atob/-/atob-2.1.2.tgz", + "integrity": "sha512-Wm6ukoaOGJi/73p/cl2GvLjTI5JM1k/O14isD73YML8StrH/7/lRFgmg8nICZgD3bZZvjwCGxtMOD3wWNAu8cg==", + "dev": true, + "optional": true + }, "autoprefixer": { "version": "10.2.4", "resolved": "https://registry.npmjs.org/autoprefixer/-/autoprefixer-10.2.4.tgz", @@ -1728,6 +2032,66 @@ "integrity": "sha1-ibTRmasr7kneFk6gK4nORi1xt2c=", "dev": true }, + "base": { + "version": "0.11.2", + "resolved": "https://registry.npmjs.org/base/-/base-0.11.2.tgz", + "integrity": "sha512-5T6P4xPgpp0YDFvSWwEZ4NoE3aM4QBQXDzmVbraCkFj8zHM+mba8SyqB5DbZWyR7mYHo6Y7BdQo3MoA4m0TeQg==", + "dev": true, + "optional": true, + "requires": { + "cache-base": "^1.0.1", + "class-utils": "^0.3.5", + "component-emitter": "^1.2.1", + "define-property": "^1.0.0", + "isobject": "^3.0.1", + "mixin-deep": "^1.2.0", + "pascalcase": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, "benchmark": { "version": "2.1.4", "resolved": "https://registry.npmjs.org/benchmark/-/benchmark-2.1.4.tgz", @@ -1826,6 +2190,24 @@ "integrity": "sha512-lGzLKcioL90C7wMczpkY0n/oART3MbBa8R9OFGE1rJxoVI86u4WAGfEk8Wjv10eKSyTHVGkSo3bvBylCEtk7LA==", "dev": true }, + "cache-base": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/cache-base/-/cache-base-1.0.1.tgz", + "integrity": "sha512-AKcdTnFSWATd5/GCPRxr2ChwIJ85CeyrEyjRHlKxQ56d4XJMGym0uAiKn0xbLOGOl3+yRpOTi484dVCEc5AUzQ==", + "dev": true, + "optional": true, + "requires": { + "collection-visit": "^1.0.0", + "component-emitter": "^1.2.1", + "get-value": "^2.0.6", + "has-value": "^1.0.0", + "isobject": "^3.0.1", + "set-value": "^2.0.0", + "to-object-path": "^0.3.0", + "union-value": "^1.0.0", + "unset-value": "^1.0.0" + } + }, "call-bind": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.2.tgz", @@ -1948,6 +2330,31 @@ } } }, + "class-utils": { + "version": "0.3.6", + "resolved": "https://registry.npmjs.org/class-utils/-/class-utils-0.3.6.tgz", + "integrity": "sha512-qOhPa/Fj7s6TY8H8esGu5QNpMMQxz79h+urzrNYN6mn+9BnxlDGf5QZ+XeCDsxSjPqsSR56XOZOJmpeurnLMeg==", + "dev": true, + "optional": true, + "requires": { + "arr-union": "^3.1.0", + "define-property": "^0.2.5", + "isobject": "^3.0.0", + "static-extend": "^0.1.1" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, "clean-stack": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", @@ -2032,6 +2439,17 @@ "q": "^1.1.2" } }, + "collection-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/collection-visit/-/collection-visit-1.0.0.tgz", + "integrity": "sha1-S8A3PBZLwykbTTaMgpzxqApZ3KA=", + "dev": true, + "optional": true, + "requires": { + "map-visit": "^1.0.0", + "object-visit": "^1.0.0" + } + }, "color": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/color/-/color-3.1.3.tgz", @@ -2091,6 +2509,13 @@ "integrity": "sha512-W6Af2Iw1z4CB7q4uU4hv646dW9GQuBM+YpC0UvUCWSD8w90SJjp+ujJuXaEMtAXBtSqGfMPuFOVn4/+FlaqfBA==", "dev": true }, + "component-emitter": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.3.0.tgz", + "integrity": "sha512-Rd3se6QB+sO1TwqZjscQrurpEPIfO0/yYnSin6Q/rD3mOutHvUrCAhJub3r90uNb+SESBuE0QYoB90YdfatsRg==", + "dev": true, + "optional": true + }, "concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", @@ -2123,6 +2548,13 @@ "safe-buffer": "~5.1.1" } }, + "copy-descriptor": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/copy-descriptor/-/copy-descriptor-0.1.1.tgz", + "integrity": "sha1-Z29us8OZl8LuGsOpJP1hJHSPV40=", + "dev": true, + "optional": true + }, "copyfiles": { "version": "2.4.1", "resolved": "https://registry.npmjs.org/copyfiles/-/copyfiles-2.4.1.tgz", @@ -2516,12 +2948,28 @@ } } }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dev": true, + "requires": { + "ms": "2.1.2" + } + }, "decamelize": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", "dev": true }, + "decode-uri-component": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/decode-uri-component/-/decode-uri-component-0.2.0.tgz", + "integrity": "sha1-6zkTMzRYd1y4TNGh+uBiEGu4dUU=", + "dev": true, + "optional": true + }, "dedent": { "version": "0.7.0", "resolved": "https://registry.npmjs.org/dedent/-/dedent-0.7.0.tgz", @@ -2558,6 +3006,51 @@ "object-keys": "^1.0.12" } }, + "define-property": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-2.0.2.tgz", + "integrity": "sha512-jwK2UV4cnPpbcG7+VRARKTZPUWowwXA8bzH5NP6ud0oeAxyYPuGZUAC7hMugpCdz4BeSZl2Dl9k66CHJ/46ZYQ==", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^1.0.2", + "isobject": "^3.0.1" + }, + "dependencies": { + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, "diff": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/diff/-/diff-4.0.2.tgz", @@ -3108,12 +3601,161 @@ "strip-final-newline": "^2.0.0" } }, + "expand-brackets": { + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/expand-brackets/-/expand-brackets-2.1.4.tgz", + "integrity": "sha1-t3c14xXOMPa27/D4OwQVGiJEliI=", + "dev": true, + "optional": true, + "requires": { + "debug": "^2.3.3", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "posix-character-classes": "^0.1.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + } + } + }, "extend": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", "dev": true }, + "extend-shallow": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-3.0.2.tgz", + "integrity": "sha1-Jqcarwc7OfshJxcnRhMcJwQCjbg=", + "dev": true, + "optional": true, + "requires": { + "assign-symbols": "^1.0.0", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "optional": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, + "extglob": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/extglob/-/extglob-2.0.4.tgz", + "integrity": "sha512-Nmb6QXkELsuBr24CJSkilo6UHHgbekK5UiZgfE6UHD3Eb27YC6oD+bhcT+tJ6cl8dmsgdQxnWlcry8ksBIBLpw==", + "dev": true, + "optional": true, + "requires": { + "array-unique": "^0.3.2", + "define-property": "^1.0.0", + "expand-brackets": "^2.1.4", + "extend-shallow": "^2.0.1", + "fragment-cache": "^0.2.1", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, "fast-deep-equal": { "version": "3.1.3", "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", @@ -3216,12 +3858,29 @@ "integrity": "sha512-zAoAQiudy+r5SvnSw3KJy5os/oRJYHzrzja/tBDqrZtNhUw8bt6y8OBzMWcjWr+8liV8Eb6yOhw8WZ7VFZ5ZzA==", "dev": true }, + "for-in": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/for-in/-/for-in-1.0.2.tgz", + "integrity": "sha1-gQaNKVqBQuwKxybG4iAMMPttXoA=", + "dev": true, + "optional": true + }, "fraction.js": { "version": "4.0.13", "resolved": "https://registry.npmjs.org/fraction.js/-/fraction.js-4.0.13.tgz", "integrity": "sha512-E1fz2Xs9ltlUp+qbiyx9wmt2n9dRzPsS11Jtdb8D2o+cC7wr9xkkKsVKJuBX0ST+LVS+LhLO+SbLJNtfWcJvXA==", "dev": true }, + "fragment-cache": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/fragment-cache/-/fragment-cache-0.2.1.tgz", + "integrity": "sha1-QpD60n8T6Jvn8zeZxrxaCr//DRk=", + "dev": true, + "optional": true, + "requires": { + "map-cache": "^0.2.2" + } + }, "fs-extra": { "version": "8.1.0", "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.1.0.tgz", @@ -3233,6 +3892,12 @@ "universalify": "^0.1.0" } }, + "fs-readdir-recursive": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fs-readdir-recursive/-/fs-readdir-recursive-1.1.0.tgz", + "integrity": "sha512-GNanXlVr2pf02+sPN40XN8HG+ePaNcvM0q5mZBd668Obwb0yD5GiUbZOFgwn8kGMY6I3mdyDJzieUy3PTYyTRA==", + "dev": true + }, "fs.realpath": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", @@ -3311,6 +3976,13 @@ "pump": "^3.0.0" } }, + "get-value": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/get-value/-/get-value-2.0.6.tgz", + "integrity": "sha1-3BXKHGcjh8p2vTesCjlbogQqLCg=", + "dev": true, + "optional": true + }, "glob": { "version": "7.1.6", "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.6.tgz", @@ -3413,6 +4085,63 @@ "integrity": "sha512-PLcsoqu++dmEIZB+6totNFKq/7Do+Z0u4oT0zKOJNl3lYK6vGwwu2hjHs+68OEZbTjiUE9bgOABXbP/GvrS0Kg==", "dev": true }, + "has-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-1.0.0.tgz", + "integrity": "sha1-GLKB2lhbHFxR3vJMkw7SmgvmsXc=", + "dev": true, + "optional": true, + "requires": { + "get-value": "^2.0.6", + "has-values": "^1.0.0", + "isobject": "^3.0.0" + } + }, + "has-values": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-1.0.0.tgz", + "integrity": "sha1-lbC2P+whRmGab+V/51Yo1aOe/k8=", + "dev": true, + "optional": true, + "requires": { + "is-number": "^3.0.0", + "kind-of": "^4.0.0" + }, + "dependencies": { + "is-number": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-3.0.0.tgz", + "integrity": "sha1-JP1iAaR4LPUFYcgQJ2r8fRLXEZU=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "kind-of": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-4.0.0.tgz", + "integrity": "sha1-IIE989cSkosgc3hpGkUGb65y3Vc=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "he": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", @@ -3687,6 +4416,28 @@ "integrity": "sha1-UFMN+4T8yap9vnhS6Do3uTufKqY=", "dev": true }, + "is-accessor-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-0.1.6.tgz", + "integrity": "sha1-qeEss66Nh2cn7u84Q/igiXtcmNY=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", @@ -3702,6 +4453,13 @@ "binary-extensions": "^2.0.0" } }, + "is-buffer": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/is-buffer/-/is-buffer-1.1.6.tgz", + "integrity": "sha512-NcdALwpXkTm5Zvvbk7owOUSvVvBKDgKP5/ewfXEznmQFfs4ZRmanOeKBTjRVjka3QFoN6XJ+9F3USqfHqTaU5w==", + "dev": true, + "optional": true + }, "is-callable": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.3.tgz", @@ -3731,18 +4489,68 @@ "has": "^1.0.3" } }, + "is-data-descriptor": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-0.1.4.tgz", + "integrity": "sha1-C17mSDiOLIYCgueT8YVv7D8wG1Y=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "is-date-object": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.2.tgz", "integrity": "sha512-USlDT524woQ08aoZFzh3/Z6ch9Y/EWXEHQ/AaRN0SkKq4t2Jw2R2339tSXmwuVoY7LLlBCbOIlx2myP/L5zk0g==", "dev": true }, + "is-descriptor": { + "version": "0.1.6", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-0.1.6.tgz", + "integrity": "sha512-avDYr0SB3DwO9zsMov0gKCESFYqCnE4hq/4z3TdUlukEy5t9C0YRq7HLrsN52NAcqXKaepeCD0n+B0arnVG3Hg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^0.1.6", + "is-data-descriptor": "^0.1.4", + "kind-of": "^5.0.0" + }, + "dependencies": { + "kind-of": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-5.1.0.tgz", + "integrity": "sha512-NGEErnH6F2vUuXDh+OlbcKW7/wOcfdRHaZ7VWtqCztfHri/++YKmP51OdWeGPuqCOba6kk2OTe5d02VmTB80Pw==", + "dev": true, + "optional": true + } + } + }, "is-directory": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/is-directory/-/is-directory-0.3.1.tgz", "integrity": "sha1-YTObbyR1/Hcv2cnYP1yFddwVSuE=", "dev": true }, + "is-extendable": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-0.1.1.tgz", + "integrity": "sha1-YrEQ4omkcUGOPsNqYX1HLjAd/Ik=", + "dev": true, + "optional": true + }, "is-extglob": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", @@ -3794,6 +4602,16 @@ "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", "dev": true }, + "is-plain-object": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-2.0.4.tgz", + "integrity": "sha512-h5PpgXkWitc38BBMYawTYMWJHFZJVnBquFE57xFpjB8pJFiF6gZ+bU+WyI/yqXiFR5mdLsgYNaPe8uao6Uv9Og==", + "dev": true, + "optional": true, + "requires": { + "isobject": "^3.0.1" + } + }, "is-reference": { "version": "1.2.1", "resolved": "https://registry.npmjs.org/is-reference/-/is-reference-1.2.1.tgz", @@ -3855,6 +4673,13 @@ "has-symbols": "^1.0.1" } }, + "is-windows": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-windows/-/is-windows-1.0.2.tgz", + "integrity": "sha512-eXK1UInq2bPmjyX6e3VHIzMLobc4J94i4AWn+Hpq3OU5KkrRC96OAcR3PRJ/pGu6m8TRnBHP9dkXQVsT/COVIA==", + "dev": true, + "optional": true + }, "isarray": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", @@ -3867,6 +4692,13 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, + "isobject": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-3.0.1.tgz", + "integrity": "sha1-TkMekrEalzFjaqH5yNHMvP2reN8=", + "dev": true, + "optional": true + }, "jest-worker": { "version": "26.6.2", "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-26.6.2.tgz", @@ -3941,6 +4773,15 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, + "json5": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.2.0.tgz", + "integrity": "sha512-f+8cldu7X/y7RAJurMEJmdoKXGB/X550w2Nr3tTbezL6RwEE/iMcm+tZnXeoZtKuOq6ft8+CqzEkrIgx1fPoQA==", + "dev": true, + "requires": { + "minimist": "^1.2.5" + } + }, "jsonfile": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-4.0.0.tgz", @@ -3966,6 +4807,13 @@ "integrity": "sha512-aWgeGFW67BP3e5181Ep1Fv2v8z//iBJfrvyTnq8wG86vEESwmonn1zPBJ0VfmT9CJq2FIT0VsETtrNFm2a+SHA==", "dev": true }, + "kind-of": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-6.0.3.tgz", + "integrity": "sha512-dcS1ul+9tmeD95T+x28/ehLgd9mENa3LsvDTtzm3vyBEO7RPptvAD+t44WVXaUjTBRcrpFeFlC8WCruUR456hw==", + "dev": true, + "optional": true + }, "kleur": { "version": "4.1.4", "resolved": "https://registry.npmjs.org/kleur/-/kleur-4.1.4.tgz", @@ -4359,6 +5207,23 @@ "semver": "^5.6.0" } }, + "map-cache": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/map-cache/-/map-cache-0.2.2.tgz", + "integrity": "sha1-wyq9C9ZSXZsFFkW7TyasXcmKDb8=", + "dev": true, + "optional": true + }, + "map-visit": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/map-visit/-/map-visit-1.0.0.tgz", + "integrity": "sha1-7Nyo8TFE5mDxtb1B8S80edmN+48=", + "dev": true, + "optional": true, + "requires": { + "object-visit": "^1.0.0" + } + }, "maxmin": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/maxmin/-/maxmin-2.1.0.tgz", @@ -4555,6 +5420,29 @@ "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==", "dev": true }, + "mixin-deep": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/mixin-deep/-/mixin-deep-1.3.2.tgz", + "integrity": "sha512-WRoDn//mXBiJ1H40rqa3vH0toePwSsGb45iInWlTySa+Uu4k3tYUSxa2v1KqAiLtvlrSzaExqS1gtk96A9zvEA==", + "dev": true, + "optional": true, + "requires": { + "for-in": "^1.0.2", + "is-extendable": "^1.0.1" + }, + "dependencies": { + "is-extendable": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-extendable/-/is-extendable-1.0.1.tgz", + "integrity": "sha512-arnXMxT1hhoKo9k1LZdmlNyJdDDfy2v0fXjFlmok4+i8ul/6WlbVge9bhM74OpNPQPMGUToDtz+KXa1PneJxOA==", + "dev": true, + "optional": true, + "requires": { + "is-plain-object": "^2.0.4" + } + } + } + }, "mkdirp": { "version": "1.0.4", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", @@ -4857,6 +5745,26 @@ "integrity": "sha512-a1cQNyczgKbLX9jwbS/+d7W8fX/RfgYR7lVWwWOGIPNgK2m0MWvrGF6/m4kk6U3QcFMnZf3RIhL0v2Jgh/0Uxw==", "dev": true }, + "nanomatch": { + "version": "1.2.13", + "resolved": "https://registry.npmjs.org/nanomatch/-/nanomatch-1.2.13.tgz", + "integrity": "sha512-fpoe2T0RbHwBTBUOftAfBPaDEi06ufaUai0mE6Yn1kacc3SnTErfb/h+X94VXzI64rKFHYImXSvdwGGCmwOqCA==", + "dev": true, + "optional": true, + "requires": { + "arr-diff": "^4.0.0", + "array-unique": "^0.3.2", + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "fragment-cache": "^0.2.1", + "is-windows": "^1.0.2", + "kind-of": "^6.0.2", + "object.pick": "^1.3.0", + "regex-not": "^1.0.0", + "snapdragon": "^0.8.1", + "to-regex": "^3.0.1" + } + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -4946,6 +5854,40 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, + "object-copy": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/object-copy/-/object-copy-0.1.0.tgz", + "integrity": "sha1-fn2Fi3gb18mRpBupde04EnVOmYw=", + "dev": true, + "optional": true, + "requires": { + "copy-descriptor": "^0.1.0", + "define-property": "^0.2.5", + "kind-of": "^3.0.3" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "object-inspect": { "version": "1.9.0", "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.9.0.tgz", @@ -4958,6 +5900,16 @@ "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, + "object-visit": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-visit/-/object-visit-1.0.1.tgz", + "integrity": "sha1-95xEk68MU3e1n+OdOV5BBC3QRbs=", + "dev": true, + "optional": true, + "requires": { + "isobject": "^3.0.0" + } + }, "object.assign": { "version": "4.1.2", "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.2.tgz", @@ -5005,6 +5957,16 @@ "es-abstract": "^1.18.0-next.1" } }, + "object.pick": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/object.pick/-/object.pick-1.3.0.tgz", + "integrity": "sha1-h6EKxMFpS9Lhy/U1kaZhQftd10c=", + "dev": true, + "optional": true, + "requires": { + "isobject": "^3.0.1" + } + }, "object.values": { "version": "1.1.2", "resolved": "https://registry.npmjs.org/object.values/-/object.values-1.1.2.tgz", @@ -5134,6 +6096,20 @@ "lines-and-columns": "^1.1.6" } }, + "pascalcase": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/pascalcase/-/pascalcase-0.1.1.tgz", + "integrity": "sha1-s2PlXoAGym/iF4TS2yK9FdeRfxQ=", + "dev": true, + "optional": true + }, + "path-dirname": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-dirname/-/path-dirname-1.0.2.tgz", + "integrity": "sha1-zDPSTVJeCZpTiMAzbG4yuRYGCeA=", + "dev": true, + "optional": true + }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -5224,6 +6200,13 @@ "semver-compare": "^1.0.0" } }, + "posix-character-classes": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/posix-character-classes/-/posix-character-classes-0.1.1.tgz", + "integrity": "sha1-AerA/jta9xoqbAL+q7jB/vfgDqs=", + "dev": true, + "optional": true + }, "postcss": { "version": "8.2.5", "resolved": "https://registry.npmjs.org/postcss/-/postcss-8.2.5.tgz", @@ -6646,6 +7629,17 @@ "integrity": "sha512-a54FxoJDIr27pgf7IgeQGxmqUNYrcV338lf/6gH456HZ/PhX+5BcwHXG9ajESmwe6WRO0tAzRUrRmNONWgkrew==", "dev": true }, + "regex-not": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/regex-not/-/regex-not-1.0.2.tgz", + "integrity": "sha512-J6SDjUgDxQj5NusnOtdFxDwN/+HWykR8GELwctJ7mdqhcyy1xEc4SRFHUXvxTp661YaVKAjfRLZ9cCqS6tn32A==", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^3.0.2", + "safe-regex": "^1.1.0" + } + }, "regexp.prototype.flags": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.3.1.tgz", @@ -6685,6 +7679,27 @@ } } }, + "remove-trailing-separator": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/remove-trailing-separator/-/remove-trailing-separator-1.1.0.tgz", + "integrity": "sha1-wkvOKig62tW8P1jg1IJJuSN52O8=", + "dev": true, + "optional": true + }, + "repeat-element": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/repeat-element/-/repeat-element-1.1.3.tgz", + "integrity": "sha512-ahGq0ZnV5m5XtZLMb+vP76kcAM5nkLqk0lpqAuojSKGgQtn4eRi4ZZGm2olo2zKFH+sMsWaqOCW1dqAnOru72g==", + "dev": true, + "optional": true + }, + "repeat-string": { + "version": "1.6.1", + "resolved": "https://registry.npmjs.org/repeat-string/-/repeat-string-1.6.1.tgz", + "integrity": "sha1-jcrkcOHIirwtYA//Sndihtp15jc=", + "dev": true, + "optional": true + }, "require-directory": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", @@ -6719,6 +7734,13 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, + "resolve-url": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/resolve-url/-/resolve-url-0.2.1.tgz", + "integrity": "sha1-LGN/53yJOv0qZj/iGqkIAGjiBSo=", + "dev": true, + "optional": true + }, "restore-cursor": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", @@ -6729,6 +7751,13 @@ "signal-exit": "^3.0.2" } }, + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true, + "optional": true + }, "rgb-regex": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/rgb-regex/-/rgb-regex-1.0.1.tgz", @@ -7047,6 +8076,16 @@ "integrity": "sha512-6pNbSMW6OhAi9j+N8V+U715yBQsaWJ7eyEUaOrawX+isg5ZxhUlV1NipNtgaKHmFGiABwt+ZF04Ii+3Xjkg+8w==", "dev": true }, + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "optional": true, + "requires": { + "ret": "~0.1.10" + } + }, "sax": { "version": "1.2.4", "resolved": "https://registry.npmjs.org/sax/-/sax-1.2.4.tgz", @@ -7086,6 +8125,31 @@ "integrity": "sha1-BF+XgtARrppoA93TgrJDkrPYkPc=", "dev": true }, + "set-value": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/set-value/-/set-value-2.0.1.tgz", + "integrity": "sha512-JxHc1weCN68wRY0fhCoXpyK55m/XPHafOmK4UWD7m2CI14GMcFypt4w/0+NV5f/ZMby2F6S2wwA7fgynh9gWSw==", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^2.0.1", + "is-extendable": "^0.1.1", + "is-plain-object": "^2.0.3", + "split-string": "^3.0.1" + }, + "dependencies": { + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + } + } + }, "shebang-command": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", @@ -7172,6 +8236,12 @@ "integrity": "sha512-IifbusYiQBpUxxFJkR3wTU68xzBN0+bxCScEaKMjBvAQERg6FnTTc1F17rseLb1tjmkJ23730AXpFI0c47FgAg==", "dev": true }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, "slice-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-4.0.0.tgz", @@ -7209,18 +8279,183 @@ } } }, + "snapdragon": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/snapdragon/-/snapdragon-0.8.2.tgz", + "integrity": "sha512-FtyOnWN/wCHTVXOMwvSv26d+ko5vWlIDD6zoUJ7LW8vh+ZBC8QdljveRP+crNrtBwioEUWy/4dMtbBjA4ioNlg==", + "dev": true, + "optional": true, + "requires": { + "base": "^0.11.1", + "debug": "^2.2.0", + "define-property": "^0.2.5", + "extend-shallow": "^2.0.1", + "map-cache": "^0.2.2", + "source-map": "^0.5.6", + "source-map-resolve": "^0.5.0", + "use": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "optional": true, + "requires": { + "ms": "2.0.0" + } + }, + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + }, + "extend-shallow": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extend-shallow/-/extend-shallow-2.0.1.tgz", + "integrity": "sha1-Ua99YUrZqfYQ6huvu5idaxxWiQ8=", + "dev": true, + "optional": true, + "requires": { + "is-extendable": "^0.1.0" + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true, + "optional": true + } + } + }, + "snapdragon-node": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/snapdragon-node/-/snapdragon-node-2.1.1.tgz", + "integrity": "sha512-O27l4xaMYt/RSQ5TR3vpWCAB5Kb/czIcqUFOM/C4fYcLnbZUc1PkjTAMjof2pBWaSTwOUd6qUHcFGVGj7aIwnw==", + "dev": true, + "optional": true, + "requires": { + "define-property": "^1.0.0", + "isobject": "^3.0.0", + "snapdragon-util": "^3.0.1" + }, + "dependencies": { + "define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-1.0.0.tgz", + "integrity": "sha1-dp66rz9KY6rTr56NMEybvnm/sOY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^1.0.0" + } + }, + "is-accessor-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-accessor-descriptor/-/is-accessor-descriptor-1.0.0.tgz", + "integrity": "sha512-m5hnHTkcVsPfqx3AKlyttIPb7J+XykHvJP2B9bZDjlhLIoEq4XoK64Vg7boZlVWYK6LUY94dYPEE7Lh0ZkZKcQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-data-descriptor": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-data-descriptor/-/is-data-descriptor-1.0.0.tgz", + "integrity": "sha512-jbRXy1FmtAoCjQkVmIVYwuuqDFUbaOeDjmed1tOGPrsMhtJA4rD9tkgA0F1qJ3gRFRXcHYVkdeaP50Q5rE/jLQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^6.0.0" + } + }, + "is-descriptor": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-descriptor/-/is-descriptor-1.0.2.tgz", + "integrity": "sha512-2eis5WqQGV7peooDyLmNEPUrps9+SXX5c9pL3xEB+4e9HnGuDa7mB7kHxHw4CbqS9k1T2hOH3miL8n8WtiYVtg==", + "dev": true, + "optional": true, + "requires": { + "is-accessor-descriptor": "^1.0.0", + "is-data-descriptor": "^1.0.0", + "kind-of": "^6.0.2" + } + } + } + }, + "snapdragon-util": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/snapdragon-util/-/snapdragon-util-3.0.1.tgz", + "integrity": "sha512-mbKkMdQKsjX4BAL4bRYTj21edOf8cN7XHdYUJEe+Zn99hVEYcMvKPct1IqNe7+AZPirn8BCDOQBHQZknqmKlZQ==", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.2.0" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, "source-map": { "version": "0.5.7", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, + "source-map-resolve": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/source-map-resolve/-/source-map-resolve-0.5.3.tgz", + "integrity": "sha512-Htz+RnsXWk5+P2slx5Jh3Q66vhQj1Cllm0zvnaY98+NFx+Dv2CF/f5O/t8x+KaNdrdIAsruNzoh/KpialbqAnw==", + "dev": true, + "optional": true, + "requires": { + "atob": "^2.1.2", + "decode-uri-component": "^0.2.0", + "resolve-url": "^0.2.1", + "source-map-url": "^0.4.0", + "urix": "^0.1.0" + } + }, + "source-map-url": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/source-map-url/-/source-map-url-0.4.1.tgz", + "integrity": "sha512-cPiFOTLUKvJFIg4SKVScy4ilPPW6rFgMgfuZJPNoDuMs3nC1HbMUycBoJw77xFIp6z1UJQJOfx6C9GMH80DiTw==", + "dev": true, + "optional": true + }, "sourcemap-codec": { "version": "1.4.8", "resolved": "https://registry.npmjs.org/sourcemap-codec/-/sourcemap-codec-1.4.8.tgz", "integrity": "sha512-9NykojV5Uih4lgo5So5dtw+f0JgJX30KCNI8gwhz2J9A15wD0Ml6tjHKwf6fTSa6fAdVBdZeNOs9eJ71qCk8vA==", "dev": true }, + "split-string": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/split-string/-/split-string-3.1.0.tgz", + "integrity": "sha512-NzNVhJDYpwceVVii8/Hu6DKfD2G+NrQHlS/V/qgv763EYudVwEcMQNxd2lh+0VrUByXN/oJkl5grOhYWvQUYiw==", + "dev": true, + "optional": true, + "requires": { + "extend-shallow": "^3.0.0" + } + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", @@ -7233,6 +8468,29 @@ "integrity": "sha512-ji9qxRnOVfcuLDySj9qzhGSEFVobyt1kIOSkj1qZzYLzq7Tos/oUUWvotUPQLlrsidqsK6tBH89Bc9kL5zHA6w==", "dev": true }, + "static-extend": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/static-extend/-/static-extend-0.1.2.tgz", + "integrity": "sha1-YICcOcv/VTNyJv1eC1IPNB8ftcY=", + "dev": true, + "optional": true, + "requires": { + "define-property": "^0.2.5", + "object-copy": "^0.1.0" + }, + "dependencies": { + "define-property": { + "version": "0.2.5", + "resolved": "https://registry.npmjs.org/define-property/-/define-property-0.2.5.tgz", + "integrity": "sha1-w1se+RjsPJkPmlvFe+BKrOxcgRY=", + "dev": true, + "optional": true, + "requires": { + "is-descriptor": "^0.1.0" + } + } + } + }, "string-argv": { "version": "0.3.1", "resolved": "https://registry.npmjs.org/string-argv/-/string-argv-0.3.1.tgz", @@ -7577,6 +8835,41 @@ "globrex": "^0.1.2" } }, + "to-object-path": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/to-object-path/-/to-object-path-0.3.0.tgz", + "integrity": "sha1-KXWIt7Dn4KwI4E5nL4XB9JmeF68=", + "dev": true, + "optional": true, + "requires": { + "kind-of": "^3.0.2" + }, + "dependencies": { + "kind-of": { + "version": "3.2.2", + "resolved": "https://registry.npmjs.org/kind-of/-/kind-of-3.2.2.tgz", + "integrity": "sha1-MeohpzS6ubuw8yRm2JOupR5KPGQ=", + "dev": true, + "optional": true, + "requires": { + "is-buffer": "^1.1.5" + } + } + } + }, + "to-regex": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/to-regex/-/to-regex-3.0.2.tgz", + "integrity": "sha512-FWtleNAtZ/Ki2qtqej2CXTOayOH9bHDQF+Q48VpWyDXjbYxA4Yz8iDB31zXOBUlOHHKidDbqGVrTUvQMPmBGBw==", + "dev": true, + "optional": true, + "requires": { + "define-property": "^2.0.2", + "extend-shallow": "^3.0.2", + "regex-not": "^1.0.2", + "safe-regex": "^1.1.0" + } + }, "to-regex-range": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", @@ -7656,6 +8949,19 @@ "integrity": "sha512-PqSoPh/pWetQ2phoj5RLiaqIk4kCNwoV3CI+LfGmWLKI3rE3kl1h59XpX2BjgDrmbxD9ARtQobPGU1SguCYuQg==", "dev": true }, + "union-value": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.1.tgz", + "integrity": "sha512-tJfXmxMeWYnczCVs7XAEvIV7ieppALdyepWMkHkwciRpZraG/xwT+s2JN8+pr1+8jCRf80FFzvr+MpQeeoF4Xg==", + "dev": true, + "optional": true, + "requires": { + "arr-union": "^3.1.0", + "get-value": "^2.0.6", + "is-extendable": "^0.1.1", + "set-value": "^2.0.1" + } + }, "uniq": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/uniq/-/uniq-1.0.1.tgz", @@ -7680,12 +8986,70 @@ "integrity": "sha1-j97XMk7G6IoP+LkF58CYzcCG1UQ=", "dev": true }, + "unset-value": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unset-value/-/unset-value-1.0.0.tgz", + "integrity": "sha1-g3aHP30jNRef+x5vw6jtDfyKtVk=", + "dev": true, + "optional": true, + "requires": { + "has-value": "^0.3.1", + "isobject": "^3.0.0" + }, + "dependencies": { + "has-value": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/has-value/-/has-value-0.3.1.tgz", + "integrity": "sha1-ex9YutpiyoJ+wKIHgCVlSEWZXh8=", + "dev": true, + "optional": true, + "requires": { + "get-value": "^2.0.3", + "has-values": "^0.1.4", + "isobject": "^2.0.0" + }, + "dependencies": { + "isobject": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-2.1.0.tgz", + "integrity": "sha1-8GVWEJaj8dou9GJy+BXIQNh+DIk=", + "dev": true, + "optional": true, + "requires": { + "isarray": "1.0.0" + } + } + } + }, + "has-values": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/has-values/-/has-values-0.1.4.tgz", + "integrity": "sha1-bWHeldkd/Km5oCCJrThL/49it3E=", + "dev": true, + "optional": true + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true, + "optional": true + } + } + }, "untildify": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/untildify/-/untildify-4.0.0.tgz", "integrity": "sha512-KK8xQ1mkzZeg9inewmFVDNkg3l5LUhoq9kN6iWYB/CC9YMG8HA+c1Q8HwDe6dEX7kErrEVNVBO3fWsVq5iDgtw==", "dev": true }, + "upath": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/upath/-/upath-1.2.0.tgz", + "integrity": "sha512-aZwGpamFO61g3OlfT7OQCHqhGnW43ieH9WZeP7QxN/G/jS4jfqUkZxoryvJgVPEcrl5NL/ggHsSmLMHuH64Lhg==", + "dev": true, + "optional": true + }, "uri-js": { "version": "4.4.1", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", @@ -7695,6 +9059,20 @@ "punycode": "^2.1.0" } }, + "urix": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", + "integrity": "sha1-2pN/emLiH+wf0Y1Js1wpNQZ6bHI=", + "dev": true, + "optional": true + }, + "use": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/use/-/use-3.1.1.tgz", + "integrity": "sha512-cwESVXlO3url9YWlFW/TA9cshCEhtu7IKJ/p5soJ/gGpj7vbvFrAY/eIioQ6Dw23KjZhYgiIo8HOs1nQ2vr/oQ==", + "dev": true, + "optional": true + }, "util-deprecate": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", diff --git a/package.json b/package.json index d0378ba6..1de805bf 100644 --- a/package.json +++ b/package.json @@ -29,7 +29,9 @@ "copy-typescript-definition": "copyfiles -f src/*.d.ts dist", "test": "eslint src test && tsc && npm run test:mocha", "test:mocha": "mocha -r @babel/register test/**/*.js", - "bench": "node -r @babel/register benchmarks/index.js", + "bench:x": "node -r @babel/register benchmarks/index.js", + "bench:y": "babel benchmarks/*.js -d benchmarks/dist --env-name bench && v8 --module test/bench/benchmark.js", + "bench": "microbundle test/bench/index.js -f modern --external none --target node --no-compress --no-sourcemap -o test/bench/.dist.js && v8 --module test/bench/.dist.modern.js", "format": "prettier src/**/*.{d.ts,js} test/**/*.js --write", "prepublishOnly": "npm run build", "release": "npm run build && git commit -am $npm_package_version && git tag $npm_package_version && git push && git push --tags && npm publish" @@ -75,7 +77,22 @@ "pragma": "h" } ] - ] + ], + "env": { + "bench": { + "presets": [ + [ + "@babel/preset-env", + { + "targets": { + "node": true + }, + "modules": false + } + ] + ] + } + } }, "author": "Jason Miller ", "license": "MIT", @@ -87,6 +104,8 @@ "preact": ">=10" }, "devDependencies": { + "@babel/cli": "^7.12.13", + "@babel/core": "^7.12.13", "@babel/plugin-transform-react-jsx": "^7.12.12", "@babel/preset-env": "^7.12.11", "@babel/register": "^7.12.10", @@ -124,4 +143,4 @@ "pre-commit": "lint-staged" } } -} +} \ No newline at end of file diff --git a/benchmarks/stack.js b/test/bench/fixtures/stack.js similarity index 100% rename from benchmarks/stack.js rename to test/bench/fixtures/stack.js diff --git a/benchmarks/text.js b/test/bench/fixtures/text.js similarity index 100% rename from benchmarks/text.js rename to test/bench/fixtures/text.js From 2a6f8c16c715270d1feced457640a600ffa25c5e Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Tue, 9 Feb 2021 17:51:04 -0500 Subject: [PATCH 05/13] Add d8-based benchmark runner --- test/bench/index.js | 28 +++++++ test/bench/runner.js | 185 +++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 213 insertions(+) create mode 100644 test/bench/index.js create mode 100644 test/bench/runner.js diff --git a/test/bench/index.js b/test/bench/index.js new file mode 100644 index 00000000..c940012b --- /dev/null +++ b/test/bench/index.js @@ -0,0 +1,28 @@ +import { h } from 'preact'; +import { describe, test, expect, benchmark } from './runner.js'; +import renderToString from '../../src/ropes.js'; +import TextApp from './fixtures/text.js'; +import StackApp from './fixtures/stack.js'; + +describe('performance', () => { + test('text', () => { + const html = renderToString(h(TextApp)); + print(html.length + '\n\n'); + const { hz } = benchmark('text', () => { + if (renderToString(h(TextApp)) !== html) { + throw Error('mismatch'); + } + }); + expect(hz).toBeGreaterThan(20); + }); + + test('stack', () => { + const html = renderToString(h(StackApp)); + const { hz } = benchmark('stack', () => { + if (renderToString(h(StackApp)) !== html) { + throw Error('mismatch'); + } + }); + expect(hz).toBeGreaterThan(150); + }); +}); diff --git a/test/bench/runner.js b/test/bench/runner.js new file mode 100644 index 00000000..8f2ee604 --- /dev/null +++ b/test/bench/runner.js @@ -0,0 +1,185 @@ +/** + * Copyright 2018 Google Inc. All Rights Reserved. + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * http://www.apache.org/licenses/LICENSE-2.0 + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + */ + +/*global globalThis*/ + +export function benchmark(name, executor, iterations = 10, timeLimit = 5000) { + let count = 0; + let now = performance.now(), + start = now, + prev = now; + const times = []; + do { + for (let i = iterations; i--; ) executor(++count); + prev = now; + now = performance.now(); + times.push((now - prev) / iterations); + } while (now - start < timeLimit); + const elapsed = now - start; + const hz = ((count / elapsed) * 1000) | 0; + const average = toFixed(elapsed / count); + const middle = (times.length / 2) | 0; + const median = toFixed((times[middle] + times[middle + 1]) / 2); + const hzStr = hz.toLocaleString(); + const averageStr = average.toLocaleString(); + const n = times.length; + const stdev = times.reduce((c, t) => c + (t - average) ** 2, 0) / n; + const p95 = toFixed((1.96 * stdev) / Math.sqrt(n)); + console.log( + `\x1b[36m${name}:\x1b[0m ${hzStr}/s, average: ${averageStr}ms, median: ${median}ms, ±${p95}` + ); + return { elapsed, hz, average, median }; +} +globalThis.benchmark = benchmark; +const toFixed = (v) => ((v * 100) | 0) / 100; + +const queue = []; +let stack = []; +let index = 0; + +async function process() { + const id = index++; + if (id === queue.length) { + queue.length = index = 0; + return; + } + const [op, name, fn, extra] = queue[id]; + queue[id] = undefined; + await processors[op](name, fn, extra); + await process(); +} + +const processors = { + async describe(name, fn, path) { + stack.push(name); + log('INFO', name); + await fn(); + stack.pop(); + }, + async test(name, fn, path) { + let stackBefore = stack; + stack = path.concat(name); + logBuffer = []; + await new Promise((resolve) => { + let calls = 0; + const done = () => { + if (calls++) throw Error(`Callback called multiple times\n\t${name}`); + // log('INFO', `${name}`); + resolve(); + }; + log('INFO', name); + Promise.resolve(done) + .then(fn) + .then(() => calls || done()) + .catch((err) => { + // log('ERROR', `${name}`); + log('ERROR', ' 🚨 ' + String(err.stack || err.message || err)); + resolve(); + }); + }); + for (let i = 0; i < logBuffer.length; i++) log(...logBuffer[i]); + logBuffer = undefined; + stack = stackBefore; + } +}; + +let logBuffer; + +function wrap(obj, method) { + obj[method] = function () { + let out = ' '; + for (let i = 0; i < arguments.length; i++) { + let val = arguments[i]; + if (typeof val === 'object' && val) { + val = JSON.stringify(val); + } + if (i) out += ' '; + out += val; + } + if (method !== 'error') out = `\u001b[37m${out}\u001b[0m`; + if (logBuffer) { + logBuffer.push([method.toUpperCase(), out, 1]); + } else { + log(method.toUpperCase(), out); + } + }; +} +wrap(console, 'log'); +wrap(console, 'info'); +wrap(console, 'warn'); +wrap(console, 'error'); + +function log(type, msg) { + if (type === 'ERROR') { + msg = `\x1b[31m${msg}\x1b[39m`; + } + if (type === 'SUCCESS') { + msg = `\x1b[32m${msg}\x1b[39m`; + } + print(Array.from({ length: stack.length }).fill(' ').join('') + msg); +} + +function push(op, name, fn, extra) { + if (queue.push([op, name, fn, extra]) === 1) { + setTimeout(process); + } +} + +export function describe(name, fn) { + push('describe', name, fn, stack.slice()); +} + +export function test(name, fn) { + push('test', name, fn, stack.slice()); +} + +export function expect(subject) { + return new Expect(subject); +} + +globalThis.describe = describe; +globalThis.test = test; +globalThis.expect = expect; + +const SUBJECT = Symbol.for('subject'); +const NEGATED = Symbol.for('negated'); +class Expect { + constructor(subject) { + this[SUBJECT] = subject; + this[NEGATED] = false; + } + get not() { + this[NEGATED] = true; + return this; + } + toBeGreaterThan(value) { + const subject = this[SUBJECT]; + const negated = this[NEGATED]; + + const isOver = subject > value; + const neg = negated ? ' not' : ''; + const type = isOver !== negated ? 'SUCCESS' : 'ERROR'; + const icon = isOver !== negated ? '✅ ' : '❌ '; + let msg = `${icon} Expected ${subject}${neg} to be greater than ${value}`; + if (logBuffer) { + for (let i = logBuffer.length; i-- > -1; ) { + if (i < 0 || logBuffer[i][2] === 1) { + logBuffer.splice(i + 1, 0, [type, msg, 1]); + break; + } + } + } else { + log(type, msg); + } + } +} From 8a9f7924e2bca38c1ed97543f5dda0e489383af5 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Tue, 9 Feb 2021 17:51:27 -0500 Subject: [PATCH 06/13] minor performance tweaks --- src/index.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/src/index.js b/src/index.js index 19a51441..9ae74f5e 100644 --- a/src/index.js +++ b/src/index.js @@ -39,9 +39,13 @@ renderToString.render = renderToString; */ let shallowRender = (vnode, context) => renderToString(vnode, context, SHALLOW); +let cache = {}; + const EMPTY_ARR = []; function renderToString(vnode, context, opts) { + cache = {}; const res = _renderToString(vnode, context, opts); + cache = {}; // options._commit, we don't schedule any effects in this library right now, // so we can pass an empty queue to this hook. if (options.__c) options.__c(vnode, EMPTY_ARR); @@ -70,7 +74,8 @@ function _renderToString(vnode, context, opts, inner, isSvgMode, selectValue) { // #text nodes if (typeof vnode !== 'object' && !nodeName) { - return encodeEntities(vnode); + if (vnode in cache) return cache[vnode]; + return (cache[vnode] = encodeEntities(vnode)); } // components @@ -132,7 +137,7 @@ function _renderToString(vnode, context, opts, inner, isSvgMode, selectValue) { : context; // stateless functional components - rendered = nodeName.call(vnode.__c, props, cctx); + rendered = nodeName.call(c, props, cctx); } else { // class-based components let cxType = nodeName.contextType; From 5bd76c8cc971a2e6c9257cf151f8168707627cdd Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Tue, 9 Feb 2021 17:52:04 -0500 Subject: [PATCH 07/13] Add prototype array ropes implementation --- src/ropes.js | 369 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 369 insertions(+) create mode 100644 src/ropes.js diff --git a/src/ropes.js b/src/ropes.js new file mode 100644 index 00000000..596ab5be --- /dev/null +++ b/src/ropes.js @@ -0,0 +1,369 @@ +import { encodeEntities, styleObjToCss, assign, getChildren } from './util'; +import { options, Fragment } from 'preact'; + +const VOID_ELEMENTS = /^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/; + +const UNSAFE_NAME = /[\s\n\\/='"\0<>]/; + +function noop() {} + +let s = []; +let opts = {}; +let cache = {}; +let cache2 = {}; + +/** + * Render Preact JSX + Components to an HTML string. + * @param {import('preact').VNode} vnode A Virtual DOM element to render. + */ +export default function (vnode, _opts) { + opts = _opts || {}; + try { + renderVNode(vnode, {}, null, false); + return s.join(''); + } finally { + s = []; + cache = {}; + cache2 = {}; + } +} + +/** + * Render a Virtual DOM element (of any kind) to HTML. + * @param {import('preact').VNode|string|number|Array} any renderable value + * @param {object} context (forks throughout the tree) + * @param {any} the current select value, passed down through the tree to set + * @param {{ s: string }} A "string buffer" object, for passing around references to the WIP output string "s". + */ +function renderVNode(vnode, context, selectValue, isSvgMode) { + if (vnode == null || typeof vnode === 'boolean') { + return; + } + + // wrap array nodes in Fragment + if (typeof vnode === 'object') { + if (Array.isArray(vnode)) { + let children = []; + // let out = [s]; + getChildren(children, vnode); + for (let i = 0; i < children.length; i++) { + // s = ''; + renderVNode(children[i], context, selectValue, isSvgMode); + // out.push(s); + } + // s = out.join(''); + return; + } + } else { + if (vnode in cache) s.push(cache[vnode]); + else s.push((cache[vnode] = encodeEntities(vnode))); + return; + } + + let nodeName = vnode.type, + props = vnode.props, + isComponent = false; + + context = context || {}; + + // components + if (typeof nodeName === 'function') { + if (nodeName === Fragment) { + renderVNode(vnode.props.children); + return; + } + + isComponent = true; + // if (nodeName===Fragment) { + // let rendered = ''; + // let children = []; + // getChildren(children, vnode.props.children); + // for (let i = 0; i < children.length; i++) { + // rendered += renderToString(children[i], context, selectValue); + // } + // return rendered; + // } + + let rendered; + + let c = (vnode.__c = { + __v: vnode, + context, + props: vnode.props, + // silently drop state updates + setState: noop, + forceUpdate: noop, + // hooks + __h: [] + }); + + // options._diff + if (options.__b) options.__b(vnode); + + // options.render + if (options.__r) options.__r(vnode); + + if (!('prototype' in nodeName) || !('render' in nodeName.prototype)) { + // Necessary for createContext api. Setting this property will pass + // the context value as `this.context` just for this component. + let cxType = nodeName.contextType; + let provider = cxType && context[cxType.__c]; + let cctx = + cxType != null + ? provider + ? provider.props.value + : cxType.__ + : context; + + // stateless functional components + rendered = nodeName.call(c, props, cctx); + } else { + // class-based components + let cxType = nodeName.contextType; + let provider = cxType && context[cxType.__c]; + let cctx = + cxType != null + ? provider + ? provider.props.value + : cxType.__ + : context; + + c = vnode.__c = new nodeName(props, cctx); + c.__v = vnode; + // turn off stateful re-rendering: + c._dirty = c.__d = true; + c.props = props; + if (c.state == null) c.state = {}; + + if (c._nextState == null && c.__s == null) { + c._nextState = c.__s = c.state; + } + + c.context = cctx; + if ('getDerivedStateFromProps' in nodeName) { + c.state = assign( + assign({}, c.state), + nodeName.getDerivedStateFromProps(c.props, c.state) + ); + } else if ('componentWillMount' in c) { + c.componentWillMount(); + } + + // If the user called setState in cWM we need to flush pending, + // state updates. This is the same behaviour in React. + c.state = + c._nextState !== c.state + ? c._nextState + : c.__s !== c.state + ? c.__s + : c.state; + + rendered = c.render(c.props, c.state, c.context); + } + + if ('getChildContext' in c) { + context = assign(assign({}, context), c.getChildContext()); + } + + if (options.diffed) options.diffed(vnode); + + renderVNode(rendered, context, selectValue, isSvgMode); + return; + } + + /* + if (UNSAFE_NAME.test(nodeName)) return; + + let s = '<'; + // p.s += '<'; + // p.s += nodeName; + let html; + s += nodeName; + + if (props) { + if (nodeName === 'option' && selectValue === props.value) { + // p.s += ' selected'; + s += ' selected'; + } + + for (let name in props) { + let v = props[name]; + let type; + if ( + name === 'children' || + name === 'key' || + name === 'ref' || + UNSAFE_NAME.test(name) + ) { + // skip + } else if (nodeName === 'select' && name === 'value') { + selectValue = v; + } else if (name === 'dangerouslySetInnerHTML') { + html = v && v.__html; + } else if ((v || v === 0) && (type = typeof v) !== 'function') { + if (name === 'style' && type === 'object') { + v = styleObjToCss(v); + } else if (name.substring(0, 5) === 'xlink') { + // this doesn't actually need to be limited to SVG, since attributes "xlinkHref" are invalid anyway + name = name.replace(/^xlink([A-Z])/, 'xlink:$1'); + } + s += ' '; + s += name; + if (v !== true && v !== '') { + s += '="'; + s += encodeEntities(v); + s += '"'; + } + } + } + } + + let isVoid = VOID_ELEMENTS.test(nodeName); + if (isVoid) { + s += ' />'; + } else { + s += '>'; + } + + if (html) { + s += html; + } else if (props && props.children) { + renderVNode(props.children, context, selectValue, p); + } + + if (!isVoid) { + s += ''; + } + */ + + if (UNSAFE_NAME.test(nodeName)) + throw new Error(`${nodeName} is not a valid HTML tag name in ${s}`); + + s.push('<'); + s.push(nodeName); + + // render JSX to HTML + let propChildren, html; + + if (props) { + let attrs = Object.keys(props); + + // allow sorting lexicographically for more determinism (useful for tests, such as via preact-jsx-chai) + if (opts.sortAttributes === true) attrs.sort(); + + for (let i = 0; i < attrs.length; i++) { + let name = attrs[i], + v = props[name]; + if (name === 'children') { + propChildren = v; + continue; + } + + if (UNSAFE_NAME.test(name)) continue; + + if ( + !opts.allAttributes && + (name === 'key' || + name === 'ref' || + name === '__self' || + name === '__source' || + name === 'defaultValue') + ) + continue; + + if (name === 'className') { + if (props.class) continue; + name = 'class'; + } else if (isSvgMode && name.indexOf('xlinkH') === 0) { + name = name.replace('H', ':h').toLowerCase(); + } + + if (name === 'htmlFor') { + if (props.for) continue; + name = 'for'; + } + + if (name === 'style' && v && typeof v === 'object') { + v = styleObjToCss(v); + } + + // always use string values instead of booleans for aria attributes + // also see https://github.com/preactjs/preact/pull/2347/files + if (name[0] === 'a' && name['1'] === 'r' && typeof v === 'boolean') { + v = String(v); + } + + let hooked = + opts.attributeHook && + opts.attributeHook(name, v, context, opts, isComponent); + if (hooked || hooked === '') { + s.push(hooked); + continue; + } + + if (name === 'dangerouslySetInnerHTML') { + html = v && v.__html; + } else if (nodeName === 'textarea' && name === 'value') { + // + propChildren = v; + } else if ((v || v === 0 || v === '') && typeof v !== 'function') { + if (v === true || v === '') { + v = name; + // in non-xml mode, allow boolean attributes + if (!opts || !opts.xml) { + s.push(' ' + name); + continue; + } + } + + if (name === 'value') { + if (nodeName === 'select') { + selectValue = v; + continue; + } else if (nodeName === 'option' && selectValue == v) { + s.push(` selected`); + } + } + s.push(` ${name}="${cache2[v] || (cache2[v] = encodeEntities(v))}"`); + } + } + } + + // s += '>'; + + let isVoid = + String(nodeName).match(VOID_ELEMENTS) || + (opts.voidElements && String(nodeName).match(opts.voidElements)); + + let children; + if (isVoid) { + s.push(' />'); + } else { + s.push('>'); + if (html) { + s.push(html); + } else if ( + propChildren != null && + getChildren((children = []), propChildren).length + ) { + for (let i = 0; i < children.length; i++) { + let child = children[i]; + + if (child != null && child !== false) { + renderVNode( + child, + context, + selectValue, + nodeName === 'svg' || (nodeName !== 'foreignObject' && isSvgMode) + ); + } + } + } + s.push(``); + } + + // s += out; + // opts.s += s; +} From 6142b18a184fddeb0cc1789ba461271781975d92 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Wed, 10 Feb 2021 11:26:16 -0500 Subject: [PATCH 08/13] Fix my shoddy statistics --- test/bench/runner.js | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) diff --git a/test/bench/runner.js b/test/bench/runner.js index 8f2ee604..555bbb18 100644 --- a/test/bench/runner.js +++ b/test/bench/runner.js @@ -33,10 +33,12 @@ export function benchmark(name, executor, iterations = 10, timeLimit = 5000) { const hzStr = hz.toLocaleString(); const averageStr = average.toLocaleString(); const n = times.length; - const stdev = times.reduce((c, t) => c + (t - average) ** 2, 0) / n; + const stdev = Math.sqrt( + times.reduce((c, t) => c + (t - average) ** 2, 0) / (n - 1) + ); const p95 = toFixed((1.96 * stdev) / Math.sqrt(n)); console.log( - `\x1b[36m${name}:\x1b[0m ${hzStr}/s, average: ${averageStr}ms, median: ${median}ms, ±${p95}` + `\x1b[36m${name}:\x1b[0m ${hzStr}/s, average: ${averageStr}ms ±${p95} (median: ${median}ms)` ); return { elapsed, hz, average, median }; } @@ -162,15 +164,37 @@ class Expect { this[NEGATED] = true; return this; } + toEqual(value) { + this._result(this[SUBJECT] === value, `to equal ${value}`); + } toBeGreaterThan(value) { + this._result(this[SUBJECT] > value, `to be greater than ${value}`); + // const negated = this[NEGATED]; + + // const isOver = subject > value; + // const neg = negated ? ' not' : ''; + // const type = isOver !== negated ? 'SUCCESS' : 'ERROR'; + // const icon = isOver !== negated ? '✅ ' : '❌ '; + // let msg = `${icon} Expected ${subject}${neg} to be greater than ${value}`; + // if (logBuffer) { + // for (let i = logBuffer.length; i-- > -1; ) { + // if (i < 0 || logBuffer[i][2] === 1) { + // logBuffer.splice(i + 1, 0, [type, msg, 1]); + // break; + // } + // } + // } else { + // log(type, msg); + // } + } + _result(pass, detail) { const subject = this[SUBJECT]; const negated = this[NEGATED]; - const isOver = subject > value; const neg = negated ? ' not' : ''; - const type = isOver !== negated ? 'SUCCESS' : 'ERROR'; - const icon = isOver !== negated ? '✅ ' : '❌ '; - let msg = `${icon} Expected ${subject}${neg} to be greater than ${value}`; + const type = pass !== negated ? 'SUCCESS' : 'ERROR'; + const icon = pass !== negated ? '✅ ' : '❌ '; + let msg = `${icon} Expected ${subject}${neg} ${detail}`; if (logBuffer) { for (let i = logBuffer.length; i-- > -1; ) { if (i < 0 || logBuffer[i][2] === 1) { From 2be162f497cc9b996ad92aac30400b52a9690775 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Wed, 10 Feb 2021 11:26:24 -0500 Subject: [PATCH 09/13] benchmark old VS new --- test/bench/index.js | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/test/bench/index.js b/test/bench/index.js index c940012b..3f5397c8 100644 --- a/test/bench/index.js +++ b/test/bench/index.js @@ -1,28 +1,34 @@ import { h } from 'preact'; import { describe, test, expect, benchmark } from './runner.js'; -import renderToString from '../../src/ropes.js'; +import renderToString from '../../src/index.js'; +import renderToStringFast from '../../src/ropes.js'; import TextApp from './fixtures/text.js'; import StackApp from './fixtures/stack.js'; describe('performance', () => { test('text', () => { const html = renderToString(h(TextApp)); - print(html.length + '\n\n'); - const { hz } = benchmark('text', () => { - if (renderToString(h(TextApp)) !== html) { - throw Error('mismatch'); - } + const html2 = renderToStringFast(h(TextApp)); + expect(html.length).toEqual(html2.length); + const before = benchmark('before', () => { + if (renderToString(h(TextApp)) !== html) throw Error('mismatch'); }); - expect(hz).toBeGreaterThan(20); + const fast = benchmark('faster', () => { + if (renderToStringFast(h(TextApp)) !== html) throw Error('mismatch'); + }); + expect(fast.hz).toBeGreaterThan(before.hz); }); test('stack', () => { const html = renderToString(h(StackApp)); - const { hz } = benchmark('stack', () => { - if (renderToString(h(StackApp)) !== html) { - throw Error('mismatch'); - } + const html2 = renderToStringFast(h(StackApp)); + expect(html.length).toEqual(html2.length); + const before = benchmark('before', () => { + if (renderToString(h(StackApp)) !== html) throw Error('mismatch'); + }); + const fast = benchmark('faster', () => { + if (renderToStringFast(h(StackApp)) !== html) throw Error('mismatch'); }); - expect(hz).toBeGreaterThan(150); + expect(fast.hz).toBeGreaterThan(before.hz); }); }); From a57eb345453df81fc35b8930ee34a60aa0320d7b Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Wed, 10 Feb 2021 17:07:10 -0500 Subject: [PATCH 10/13] add full string ropes implementation --- src/ropes-str.js | 371 +++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 371 insertions(+) create mode 100644 src/ropes-str.js diff --git a/src/ropes-str.js b/src/ropes-str.js new file mode 100644 index 00000000..8b6566ad --- /dev/null +++ b/src/ropes-str.js @@ -0,0 +1,371 @@ +import { encodeEntities, styleObjToCss, assign, getChildren } from './util'; +import { options, Fragment } from 'preact'; + +const VOID_ELEMENTS = /^(area|base|br|col|embed|hr|img|input|link|meta|param|source|track|wbr)$/; + +const UNSAFE_NAME = /[\s\n\\/='"\0<>]/; + +function noop() {} + +let s = ''; +let opts = {}; +let cache = {}; +let cache2 = {}; + +/** + * Render Preact JSX + Components to an HTML string. + * @param {import('preact').VNode} vnode A Virtual DOM element to render. + */ +export default function (vnode, _opts) { + opts = _opts || {}; + let oldS = s; + s = ''; + try { + renderVNode(vnode, {}, null, false); + return s; + } finally { + s = oldS; + cache = {}; + cache2 = {}; + } +} + +/** + * Render a Virtual DOM element (of any kind) to HTML. + * @param {import('preact').VNode|string|number|Array} any renderable value + * @param {object} context (forks throughout the tree) + * @param {any} the current select value, passed down through the tree to set + * @param {{ s: string }} A "string buffer" object, for passing around references to the WIP output string "s". + */ +function renderVNode(vnode, context, selectValue, isSvgMode) { + if (vnode == null || typeof vnode === 'boolean') { + return; + } + + // wrap array nodes in Fragment + if (typeof vnode === 'object') { + if (Array.isArray(vnode)) { + let children = []; + getChildren(children, vnode); + for (let i = 0; i < children.length; i++) { + renderVNode(children[i], context, selectValue, isSvgMode); + } + return; + } + } else { + s = + s + + (vnode in cache ? cache[vnode] : (cache[vnode] = encodeEntities(vnode))); + return; + } + + let nodeName = vnode.type, + props = vnode.props, + isComponent = false; + + context = context || {}; + + // components + if (typeof nodeName === 'function') { + if (nodeName === Fragment) { + renderVNode(vnode.props.children); + return; + } + + isComponent = true; + // if (nodeName===Fragment) { + // let rendered = ''; + // let children = []; + // getChildren(children, vnode.props.children); + // for (let i = 0; i < children.length; i++) { + // rendered += renderToString(children[i], context, selectValue); + // } + // return rendered; + // } + + let rendered; + + let c = (vnode.__c = { + __v: vnode, + context, + props: vnode.props, + // silently drop state updates + setState: noop, + forceUpdate: noop, + // hooks + __h: [] + }); + + // options._diff + if (options.__b) options.__b(vnode); + + // options.render + if (options.__r) options.__r(vnode); + + if (!('prototype' in nodeName) || !('render' in nodeName.prototype)) { + // Necessary for createContext api. Setting this property will pass + // the context value as `this.context` just for this component. + let cxType = nodeName.contextType; + let provider = cxType && context[cxType.__c]; + let cctx = + cxType != null + ? provider + ? provider.props.value + : cxType.__ + : context; + + // stateless functional components + rendered = nodeName.call(c, props, cctx); + } else { + // class-based components + let cxType = nodeName.contextType; + let provider = cxType && context[cxType.__c]; + let cctx = + cxType != null + ? provider + ? provider.props.value + : cxType.__ + : context; + + c = vnode.__c = new nodeName(props, cctx); + c.__v = vnode; + // turn off stateful re-rendering: + c._dirty = c.__d = true; + c.props = props; + if (c.state == null) c.state = {}; + + if (c._nextState == null && c.__s == null) { + c._nextState = c.__s = c.state; + } + + c.context = cctx; + if ('getDerivedStateFromProps' in nodeName) { + c.state = assign( + assign({}, c.state), + nodeName.getDerivedStateFromProps(c.props, c.state) + ); + } else if ('componentWillMount' in c) { + c.componentWillMount(); + } + + // If the user called setState in cWM we need to flush pending, + // state updates. This is the same behaviour in React. + c.state = + c._nextState !== c.state + ? c._nextState + : c.__s !== c.state + ? c.__s + : c.state; + + rendered = c.render(c.props, c.state, c.context); + } + + if ('getChildContext' in c) { + context = assign(assign({}, context), c.getChildContext()); + } + + if (options.diffed) options.diffed(vnode); + + renderVNode(rendered, context, selectValue, isSvgMode); + return; + } + + /* + if (UNSAFE_NAME.test(nodeName)) return; + + let s = '<'; + // p.s += '<'; + // p.s += nodeName; + let html; + s += nodeName; + + if (props) { + if (nodeName === 'option' && selectValue === props.value) { + // p.s += ' selected'; + s += ' selected'; + } + + for (let name in props) { + let v = props[name]; + let type; + if ( + name === 'children' || + name === 'key' || + name === 'ref' || + UNSAFE_NAME.test(name) + ) { + // skip + } else if (nodeName === 'select' && name === 'value') { + selectValue = v; + } else if (name === 'dangerouslySetInnerHTML') { + html = v && v.__html; + } else if ((v || v === 0) && (type = typeof v) !== 'function') { + if (name === 'style' && type === 'object') { + v = styleObjToCss(v); + } else if (name.substring(0, 5) === 'xlink') { + // this doesn't actually need to be limited to SVG, since attributes "xlinkHref" are invalid anyway + name = name.replace(/^xlink([A-Z])/, 'xlink:$1'); + } + s += ' '; + s += name; + if (v !== true && v !== '') { + s += '="'; + s += encodeEntities(v); + s += '"'; + } + } + } + } + + let isVoid = VOID_ELEMENTS.test(nodeName); + if (isVoid) { + s += ' />'; + } else { + s += '>'; + } + + if (html) { + s += html; + } else if (props && props.children) { + renderVNode(props.children, context, selectValue, p); + } + + if (!isVoid) { + s += ''; + } + */ + + if (UNSAFE_NAME.test(nodeName)) + throw new Error(`${nodeName} is not a valid HTML tag name in ${s}`); + + s = s + '<' + nodeName; + + // render JSX to HTML + let propChildren, html; + + if (props) { + let attrs = Object.keys(props); + + // allow sorting lexicographically for more determinism (useful for tests, such as via preact-jsx-chai) + if (opts.sortAttributes === true) attrs.sort(); + + for (let i = 0; i < attrs.length; i++) { + let name = attrs[i], + v = props[name]; + if (name === 'children') { + propChildren = v; + continue; + } + + if (UNSAFE_NAME.test(name)) continue; + + if ( + !opts.allAttributes && + (name === 'key' || + name === 'ref' || + name === '__self' || + name === '__source' || + name === 'defaultValue') + ) + continue; + + if (name === 'className') { + if (props.class) continue; + name = 'class'; + } else if (isSvgMode && name.indexOf('xlinkH') === 0) { + name = name.replace('H', ':h').toLowerCase(); + } + + if (name === 'htmlFor') { + if (props.for) continue; + name = 'for'; + } + + if (name === 'style' && v && typeof v === 'object') { + v = styleObjToCss(v); + } + + // always use string values instead of booleans for aria attributes + // also see https://github.com/preactjs/preact/pull/2347/files + if (name[0] === 'a' && name['1'] === 'r' && typeof v === 'boolean') { + v = String(v); + } + + let hooked = + opts.attributeHook && + opts.attributeHook(name, v, context, opts, isComponent); + if (hooked || hooked === '') { + s = s + hooked; + continue; + } + + if (name === 'dangerouslySetInnerHTML') { + html = v && v.__html; + } else if (nodeName === 'textarea' && name === 'value') { + // + propChildren = v; + } else if ((v || v === 0 || v === '') && typeof v !== 'function') { + if (v === true || v === '') { + v = name; + // in non-xml mode, allow boolean attributes + if (!opts || !opts.xml) { + s = s + ' ' + name; + continue; + } + } + + if (name === 'value') { + if (nodeName === 'select') { + selectValue = v; + continue; + } else if (nodeName === 'option' && selectValue == v) { + s = s + ` selected`; + } + } + // s += ` ${name}="${encodeEntities(v)}"`; + s = + s + + ' ' + + name + + '="' + + (cache2[v] || (cache2[v] = encodeEntities(v))) + + '"'; + } + } + } + + // s += '>'; + + let isVoid = + String(nodeName).match(VOID_ELEMENTS) || + (opts.voidElements && String(nodeName).match(opts.voidElements)); + + let children; + if (isVoid) { + s = s + ' />'; + } else { + s = s + '>'; + if (html) { + s = s + html; + } else if ( + propChildren != null && + getChildren((children = []), propChildren).length + ) { + for (let i = 0; i < children.length; i++) { + let child = children[i]; + + if (child != null && child !== false) { + renderVNode( + child, + context, + selectValue, + nodeName === 'svg' || (nodeName !== 'foreignObject' && isSvgMode) + ); + } + } + } + s = s + ''; + } +} From f99f982acf3a5d794ad1669f08f7ddf2459a2798 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Wed, 10 Feb 2021 17:12:23 -0500 Subject: [PATCH 11/13] Add entity-encoding cache, use string ropes to buffer small strings during attribute rendering. --- src/ropes.js | 69 ++++++++++++++++++++++++++++++++++------------------ src/util.js | 22 ++++++----------- 2 files changed, 53 insertions(+), 38 deletions(-) diff --git a/src/ropes.js b/src/ropes.js index 596ab5be..594d36fa 100644 --- a/src/ropes.js +++ b/src/ropes.js @@ -7,24 +7,48 @@ const UNSAFE_NAME = /[\s\n\\/='"\0<>]/; function noop() {} +/** + * Current output buffer + * @type {string[]} + * */ let s = []; -let opts = {}; + +/** + * Current text encoding cache + * @type {Map} + */ let cache = {}; -let cache2 = {}; + +/** + * Current attribute encoding cache + * @type {Map} + */ +let attrCache = {}; + +/** + * Current rendering options + * @type {{ pretty, shallow, shallowHighOrder, renderRootComponent, sortAttributes, allAttributes, attributeHook, xml, voidElements }} + */ +let opts = {}; /** * Render Preact JSX + Components to an HTML string. * @param {import('preact').VNode} vnode A Virtual DOM element to render. + * @param {object} context Initial context for the root node */ export default function (vnode, _opts) { + let oldS = s; + let oldOpts = opts; opts = _opts || {}; + s = []; try { renderVNode(vnode, {}, null, false); return s.join(''); } finally { - s = []; cache = {}; - cache2 = {}; + attrCache = {}; + s = oldS; + opts = oldOpts; } } @@ -32,8 +56,8 @@ export default function (vnode, _opts) { * Render a Virtual DOM element (of any kind) to HTML. * @param {import('preact').VNode|string|number|Array} any renderable value * @param {object} context (forks throughout the tree) - * @param {any} the current select value, passed down through the tree to set - * @param {{ s: string }} A "string buffer" object, for passing around references to the WIP output string "s". + * @param {any} selectValue the current select value, passed down through the tree to set + * @param {boolean} isSvgMode are we rendering within an SVG? */ function renderVNode(vnode, context, selectValue, isSvgMode) { if (vnode == null || typeof vnode === 'boolean') { @@ -44,19 +68,14 @@ function renderVNode(vnode, context, selectValue, isSvgMode) { if (typeof vnode === 'object') { if (Array.isArray(vnode)) { let children = []; - // let out = [s]; getChildren(children, vnode); for (let i = 0; i < children.length; i++) { - // s = ''; renderVNode(children[i], context, selectValue, isSvgMode); - // out.push(s); } - // s = out.join(''); return; } } else { - if (vnode in cache) s.push(cache[vnode]); - else s.push((cache[vnode] = encodeEntities(vnode))); + s.push(cache[vnode] || (cache[vnode] = encodeEntities(vnode))); return; } @@ -69,7 +88,7 @@ function renderVNode(vnode, context, selectValue, isSvgMode) { // components if (typeof nodeName === 'function') { if (nodeName === Fragment) { - renderVNode(vnode.props.children); + renderVNode(vnode.props.children, context, selectValue, isSvgMode); return; } @@ -241,8 +260,7 @@ function renderVNode(vnode, context, selectValue, isSvgMode) { if (UNSAFE_NAME.test(nodeName)) throw new Error(`${nodeName} is not a valid HTML tag name in ${s}`); - s.push('<'); - s.push(nodeName); + let buf = '<' + nodeName; // render JSX to HTML let propChildren, html; @@ -299,7 +317,7 @@ function renderVNode(vnode, context, selectValue, isSvgMode) { opts.attributeHook && opts.attributeHook(name, v, context, opts, isComponent); if (hooked || hooked === '') { - s.push(hooked); + buf = buf + hooked; continue; } @@ -313,7 +331,7 @@ function renderVNode(vnode, context, selectValue, isSvgMode) { v = name; // in non-xml mode, allow boolean attributes if (!opts || !opts.xml) { - s.push(' ' + name); + buf = buf + ' ' + name; continue; } } @@ -323,10 +341,16 @@ function renderVNode(vnode, context, selectValue, isSvgMode) { selectValue = v; continue; } else if (nodeName === 'option' && selectValue == v) { - s.push(` selected`); + buf = buf + ' selected'; } } - s.push(` ${name}="${cache2[v] || (cache2[v] = encodeEntities(v))}"`); + buf = + buf + + ' ' + + name + + '="' + + (attrCache[v] || (attrCache[v] = encodeEntities(v))) + + '"'; } } } @@ -339,9 +363,9 @@ function renderVNode(vnode, context, selectValue, isSvgMode) { let children; if (isVoid) { - s.push(' />'); + s.push(buf + ' />'); } else { - s.push('>'); + s.push(buf + '>'); if (html) { s.push(html); } else if ( @@ -363,7 +387,4 @@ function renderVNode(vnode, context, selectValue, isSvgMode) { } s.push(``); } - - // s += out; - // opts.s += s; } diff --git a/src/util.js b/src/util.js index 349e2fe1..fd01e5c4 100644 --- a/src/util.js +++ b/src/util.js @@ -1,21 +1,15 @@ // DOM properties that should NOT have "px" added when numeric export const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i; +function replacer(s) { + if (s === '&') return '&'; + if (s === '<') return '<'; + if (s === '>') return '>'; + return '"'; +} + export function encodeEntities(s) { - if (typeof s !== 'string') s = String(s); - let out = ''; - for (let i = 0; i < s.length; i++) { - let ch = s[i]; - // prettier-ignore - switch (ch) { - case '<': out += '<'; break; - case '>': out += '>'; break; - case '"': out += '"'; break; - case '&': out += '&'; break; - default: out += ch; - } - } - return out; + return (typeof s === 'string' ? s : String(s)).replace(/<>"&/g, replacer); } export let indent = (s, char) => From 9cc064fe1801e62f312d2e3928ec47d743d90f83 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Wed, 10 Feb 2021 17:13:13 -0500 Subject: [PATCH 12/13] last fix for my shoddy statistics --- test/bench/runner.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/test/bench/runner.js b/test/bench/runner.js index 555bbb18..81bf56b7 100644 --- a/test/bench/runner.js +++ b/test/bench/runner.js @@ -26,10 +26,12 @@ export function benchmark(name, executor, iterations = 10, timeLimit = 5000) { times.push((now - prev) / iterations); } while (now - start < timeLimit); const elapsed = now - start; - const hz = ((count / elapsed) * 1000) | 0; + const hz = Math.round((count / elapsed) * 1000); const average = toFixed(elapsed / count); - const middle = (times.length / 2) | 0; - const median = toFixed((times[middle] + times[middle + 1]) / 2); + const middle = Math.floor(times.length / 2); + const middle2 = Math.ceil(times.length / 2); + times.sort((a, b) => a - b); + const median = toFixed((times[middle] + times[middle2]) / 2); const hzStr = hz.toLocaleString(); const averageStr = average.toLocaleString(); const n = times.length; From 48058d67757ffaae11e42005ed5a7e2aaec2cde9 Mon Sep 17 00:00:00 2001 From: Jason Miller Date: Wed, 10 Feb 2021 17:21:30 -0500 Subject: [PATCH 13/13] slight performance improvement for entity encoding --- src/util.js | 16 +++++++++++----- 1 file changed, 11 insertions(+), 5 deletions(-) diff --git a/src/util.js b/src/util.js index fd01e5c4..8377989b 100644 --- a/src/util.js +++ b/src/util.js @@ -1,11 +1,17 @@ // DOM properties that should NOT have "px" added when numeric export const IS_NON_DIMENSIONAL = /acit|ex(?:s|g|n|p|$)|rph|grid|ows|mnc|ntw|ine[ch]|zoo|^ord|^--/i; -function replacer(s) { - if (s === '&') return '&'; - if (s === '<') return '<'; - if (s === '>') return '>'; - return '"'; +function replacer(ch) { + switch (ch) { + case '<': + return '<'; + case '>': + return '>'; + case '"': + return '"'; + default: + return '&'; + } } export function encodeEntities(s) {