From 3285c8eb573c8f4ce356c2cdb14568ffe15c633f Mon Sep 17 00:00:00 2001 From: Ardalan Amini Date: Sat, 25 May 2019 01:34:07 +0430 Subject: [PATCH 1/3] Updated packages --- package-lock.json | 2498 +++++++++++++++++++++++++++------------------ package.json | 20 +- 2 files changed, 1517 insertions(+), 1001 deletions(-) diff --git a/package-lock.json b/package-lock.json index 6f0c4b7c..5368e8c0 100644 --- a/package-lock.json +++ b/package-lock.json @@ -14,22 +14,22 @@ } }, "@babel/core": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.2.2.tgz", - "integrity": "sha512-59vB0RWt09cAct5EIe58+NzGP4TFSD3Bz//2/ELy3ZeTeKF6VTD1AXlH8BGGbCX0PuobZBsIzO7IAI9PH67eKw==", + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.4.5.tgz", + "integrity": "sha512-OvjIh6aqXtlsA8ujtGKfC7LYWksYSX8yQcM8Ay3LuvVeQ63lcOKgoZWVqcpFwkd29aYU9rVx7jxhfhiEDV9MZA==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.2.2", - "@babel/helpers": "^7.2.0", - "@babel/parser": "^7.2.2", - "@babel/template": "^7.2.2", - "@babel/traverse": "^7.2.2", - "@babel/types": "^7.2.2", + "@babel/generator": "^7.4.4", + "@babel/helpers": "^7.4.4", + "@babel/parser": "^7.4.5", + "@babel/template": "^7.4.4", + "@babel/traverse": "^7.4.5", + "@babel/types": "^7.4.4", "convert-source-map": "^1.1.0", "debug": "^4.1.0", "json5": "^2.1.0", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "resolve": "^1.3.2", "semver": "^5.4.1", "source-map": "^0.5.0" @@ -53,6 +53,12 @@ "minimist": "^1.2.0" } }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, "minimist": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", @@ -64,27 +70,18 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", "dev": true - }, - "resolve": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", - "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } } } }, "@babel/generator": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.3.2.tgz", - "integrity": "sha512-f3QCuPppXxtZOEm5GWPra/uYUjmNQlu9pbAD8D/9jze4pTY83rTtB1igTBSwvkeNlC5gR24zFFkz+2WHLFQhqQ==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.4.4.tgz", + "integrity": "sha512-53UOLK6TVNqKxf7RUh8NE851EHRxOOeVXKbK2bivdb+iziMyk03Sr4eaE9OELCbyZAAafAKPDwF2TPUES5QbxQ==", "dev": true, "requires": { - "@babel/types": "^7.3.2", + "@babel/types": "^7.4.4", "jsesc": "^2.5.1", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "source-map": "^0.5.0", "trim-right": "^1.0.1" }, @@ -94,6 +91,12 @@ "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", "dev": true + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true } } }, @@ -124,23 +127,23 @@ "dev": true }, "@babel/helper-split-export-declaration": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz", - "integrity": "sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", + "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", "dev": true, "requires": { - "@babel/types": "^7.0.0" + "@babel/types": "^7.4.4" } }, "@babel/helpers": { - "version": "7.3.1", - "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.3.1.tgz", - "integrity": "sha512-Q82R3jKsVpUV99mgX50gOPCWwco9Ec5Iln/8Vyu4osNIOQgSrd9RFrQeUvmvddFNoLwMyOUWU+5ckioEKpDoGA==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.4.4.tgz", + "integrity": "sha512-igczbR/0SeuPR8RFfC7tGrbdTbFL3QTvH6D+Z6zNxnTe//GyqmtHmDkzrqDmyZ3eSwPqB/LhyKoU5DXsp+Vp2A==", "dev": true, "requires": { - "@babel/template": "^7.1.2", - "@babel/traverse": "^7.1.5", - "@babel/types": "^7.3.0" + "@babel/template": "^7.4.4", + "@babel/traverse": "^7.4.4", + "@babel/types": "^7.4.4" } }, "@babel/highlight": { @@ -192,9 +195,9 @@ } }, "@babel/parser": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.3.2.tgz", - "integrity": "sha512-QzNUC2RO1gadg+fs21fi0Uu0OuGNzRKEmgCxoLNzbCdoprLwjfmZwzUrpUNfJPaVRwBpDY47A17yYEGWyRelnQ==", + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.4.5.tgz", + "integrity": "sha512-9mUqkL1FF5T7f0WDFfAoDdiMVPWsdD1gZYzSnaXsxUCUqzuch/8of9G3VUSNiZmMBoRxT3neyVsqeiL/ZPcjew==", "dev": true }, "@babel/plugin-syntax-object-rest-spread": { @@ -207,31 +210,31 @@ } }, "@babel/template": { - "version": "7.2.2", - "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.2.2.tgz", - "integrity": "sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.4.4.tgz", + "integrity": "sha512-CiGzLN9KgAvgZsnivND7rkA+AeJ9JB0ciPOD4U59GKbQP2iQl+olF1l76kJOupqidozfZ32ghwBEJDhnk9MEcw==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/parser": "^7.2.2", - "@babel/types": "^7.2.2" + "@babel/parser": "^7.4.4", + "@babel/types": "^7.4.4" } }, "@babel/traverse": { - "version": "7.2.3", - "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.2.3.tgz", - "integrity": "sha512-Z31oUD/fJvEWVR0lNZtfgvVt512ForCTNKYcJBGbPb1QZfve4WGH8Wsy7+Mev33/45fhP/hwQtvgusNdcCMgSw==", + "version": "7.4.5", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.4.5.tgz", + "integrity": "sha512-Vc+qjynwkjRmIFGxy0KYoPj4FdVDxLej89kMHFsWScq999uX+pwcX4v9mWRjW0KcAYTPAuVQl2LKP1wEVLsp+A==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", - "@babel/generator": "^7.2.2", + "@babel/generator": "^7.4.4", "@babel/helper-function-name": "^7.1.0", - "@babel/helper-split-export-declaration": "^7.0.0", - "@babel/parser": "^7.2.3", - "@babel/types": "^7.2.2", + "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/parser": "^7.4.5", + "@babel/types": "^7.4.4", "debug": "^4.1.0", "globals": "^11.1.0", - "lodash": "^4.17.10" + "lodash": "^4.17.11" }, "dependencies": { "debug": { @@ -244,9 +247,15 @@ } }, "globals": { - "version": "11.10.0", - "resolved": "https://registry.npmjs.org/globals/-/globals-11.10.0.tgz", - "integrity": "sha512-0GZF1RiPKU97IHUO5TORo9w1PwrH/NBPl+fS7oMLdaTRiYmYbwK4NWoZWrAdd0/abG9R2BU+OiwyQpTpE6pdfQ==", + "version": "11.12.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.12.0.tgz", + "integrity": "sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA==", + "dev": true + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true }, "ms": { @@ -258,16 +267,22 @@ } }, "@babel/types": { - "version": "7.3.2", - "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.2.tgz", - "integrity": "sha512-3Y6H8xlUlpbGR+XvawiH0UXehqydTmNmEpozWcXymqwcrwYAl5KMvKtQ+TF6f6E08V6Jur7v/ykdDSF+WDEIXQ==", + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.4.4.tgz", + "integrity": "sha512-dOllgYdnEFOebhkKCjzSVFqw/PmmB8pH6RGOWkY4GsboQNd47b1fBThBSwlHAq9alF9vc1M3+6oqR47R50L0tQ==", "dev": true, "requires": { "esutils": "^2.0.2", - "lodash": "^4.17.10", + "lodash": "^4.17.11", "to-fast-properties": "^2.0.0" }, "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, "to-fast-properties": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", @@ -276,16 +291,482 @@ } } }, + "@cnakazawa/watch": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/@cnakazawa/watch/-/watch-1.0.3.tgz", + "integrity": "sha512-r5160ogAvGyHsal38Kux7YYtodEKOj89RGb28ht1jh3SJb08VwRwAKKJL0bGb04Zd/3r9FL3BFIc3bBidYffCA==", + "dev": true, + "requires": { + "exec-sh": "^0.3.2", + "minimist": "^1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, + "@jest/console": { + "version": "24.7.1", + "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.7.1.tgz", + "integrity": "sha512-iNhtIy2M8bXlAOULWVTUxmnelTLFneTNEkHCgPmgd+zNwy9zVddJ6oS5rZ9iwoscNdT5mMwUd0C51v/fSlzItg==", + "dev": true, + "requires": { + "@jest/source-map": "^24.3.0", + "chalk": "^2.0.1", + "slash": "^2.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" + } + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "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" + } + } + } + }, + "@jest/core": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/core/-/core-24.8.0.tgz", + "integrity": "sha512-R9rhAJwCBQzaRnrRgAdVfnglUuATXdwTRsYqs6NMdVcAl5euG8LtWDe+fVkN27YfKVBW61IojVsXKaOmSnqd/A==", + "dev": true, + "requires": { + "@jest/console": "^24.7.1", + "@jest/reporters": "^24.8.0", + "@jest/test-result": "^24.8.0", + "@jest/transform": "^24.8.0", + "@jest/types": "^24.8.0", + "ansi-escapes": "^3.0.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "graceful-fs": "^4.1.15", + "jest-changed-files": "^24.8.0", + "jest-config": "^24.8.0", + "jest-haste-map": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-regex-util": "^24.3.0", + "jest-resolve-dependencies": "^24.8.0", + "jest-runner": "^24.8.0", + "jest-runtime": "^24.8.0", + "jest-snapshot": "^24.8.0", + "jest-util": "^24.8.0", + "jest-validate": "^24.8.0", + "jest-watcher": "^24.8.0", + "micromatch": "^3.1.10", + "p-each-series": "^1.0.0", + "pirates": "^4.0.1", + "realpath-native": "^1.1.0", + "rimraf": "^2.5.4", + "strip-ansi": "^5.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "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" + } + }, + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "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" + } + } + } + }, + "@jest/environment": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/environment/-/environment-24.8.0.tgz", + "integrity": "sha512-vlGt2HLg7qM+vtBrSkjDxk9K0YtRBi7HfRFaDxoRtyi+DyVChzhF20duvpdAnKVBV6W5tym8jm0U9EfXbDk1tw==", + "dev": true, + "requires": { + "@jest/fake-timers": "^24.8.0", + "@jest/transform": "^24.8.0", + "@jest/types": "^24.8.0", + "jest-mock": "^24.8.0" + } + }, + "@jest/fake-timers": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/fake-timers/-/fake-timers-24.8.0.tgz", + "integrity": "sha512-2M4d5MufVXwi6VzZhJ9f5S/wU4ud2ck0kxPof1Iz3zWx6Y+V2eJrES9jEktB6O3o/oEyk+il/uNu9PvASjWXQw==", + "dev": true, + "requires": { + "@jest/types": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-mock": "^24.8.0" + } + }, + "@jest/reporters": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/reporters/-/reporters-24.8.0.tgz", + "integrity": "sha512-eZ9TyUYpyIIXfYCrw0UHUWUvE35vx5I92HGMgS93Pv7du+GHIzl+/vh8Qj9MCWFK/4TqyttVBPakWMOfZRIfxw==", + "dev": true, + "requires": { + "@jest/environment": "^24.8.0", + "@jest/test-result": "^24.8.0", + "@jest/transform": "^24.8.0", + "@jest/types": "^24.8.0", + "chalk": "^2.0.1", + "exit": "^0.1.2", + "glob": "^7.1.2", + "istanbul-lib-coverage": "^2.0.2", + "istanbul-lib-instrument": "^3.0.1", + "istanbul-lib-report": "^2.0.4", + "istanbul-lib-source-maps": "^3.0.1", + "istanbul-reports": "^2.1.1", + "jest-haste-map": "^24.8.0", + "jest-resolve": "^24.8.0", + "jest-runtime": "^24.8.0", + "jest-util": "^24.8.0", + "jest-worker": "^24.6.0", + "node-notifier": "^5.2.1", + "slash": "^2.0.0", + "source-map": "^0.6.0", + "string-length": "^2.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" + } + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "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" + } + } + } + }, + "@jest/source-map": { + "version": "24.3.0", + "resolved": "https://registry.npmjs.org/@jest/source-map/-/source-map-24.3.0.tgz", + "integrity": "sha512-zALZt1t2ou8le/crCeeiRYzvdnTzaIlpOWaet45lNSqNJUnXbppUUFR4ZUAlzgDmKee4Q5P/tKXypI1RiHwgag==", + "dev": true, + "requires": { + "callsites": "^3.0.0", + "graceful-fs": "^4.1.15", + "source-map": "^0.6.0" + }, + "dependencies": { + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, + "@jest/test-result": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/test-result/-/test-result-24.8.0.tgz", + "integrity": "sha512-+YdLlxwizlfqkFDh7Mc7ONPQAhA4YylU1s529vVM1rsf67vGZH/2GGm5uO8QzPeVyaVMobCQ7FTxl38QrKRlng==", + "dev": true, + "requires": { + "@jest/console": "^24.7.1", + "@jest/types": "^24.8.0", + "@types/istanbul-lib-coverage": "^2.0.0" + } + }, + "@jest/test-sequencer": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/test-sequencer/-/test-sequencer-24.8.0.tgz", + "integrity": "sha512-OzL/2yHyPdCHXEzhoBuq37CE99nkme15eHkAzXRVqthreWZamEMA0WoetwstsQBCXABhczpK03JNbc4L01vvLg==", + "dev": true, + "requires": { + "@jest/test-result": "^24.8.0", + "jest-haste-map": "^24.8.0", + "jest-runner": "^24.8.0", + "jest-runtime": "^24.8.0" + } + }, + "@jest/transform": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/transform/-/transform-24.8.0.tgz", + "integrity": "sha512-xBMfFUP7TortCs0O+Xtez2W7Zu1PLH9bvJgtraN1CDST6LBM/eTOZ9SfwS/lvV8yOfcDpFmwf9bq5cYbXvqsvA==", + "dev": true, + "requires": { + "@babel/core": "^7.1.0", + "@jest/types": "^24.8.0", + "babel-plugin-istanbul": "^5.1.0", + "chalk": "^2.0.1", + "convert-source-map": "^1.4.0", + "fast-json-stable-stringify": "^2.0.0", + "graceful-fs": "^4.1.15", + "jest-haste-map": "^24.8.0", + "jest-regex-util": "^24.3.0", + "jest-util": "^24.8.0", + "micromatch": "^3.1.10", + "realpath-native": "^1.1.0", + "slash": "^2.0.0", + "source-map": "^0.6.1", + "write-file-atomic": "2.4.1" + }, + "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" + } + }, + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true + }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "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" + } + } + } + }, + "@jest/types": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/@jest/types/-/types-24.8.0.tgz", + "integrity": "sha512-g17UxVr2YfBtaMUxn9u/4+siG1ptg9IGYAYwvpwn61nBg779RXnjE/m7CxYcIzEt0AbHZZAHSEZNhkE2WxURVg==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "^2.0.0", + "@types/istanbul-reports": "^1.1.1", + "@types/yargs": "^12.0.9" + } + }, + "@types/babel__core": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/@types/babel__core/-/babel__core-7.1.2.tgz", + "integrity": "sha512-cfCCrFmiGY/yq0NuKNxIQvZFy9kY/1immpSpTngOnyIbD4+eJOG5mxphhHDv3CHL9GltO4GcKr54kGBg3RNdbg==", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0", + "@types/babel__generator": "*", + "@types/babel__template": "*", + "@types/babel__traverse": "*" + } + }, + "@types/babel__generator": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@types/babel__generator/-/babel__generator-7.0.2.tgz", + "integrity": "sha512-NHcOfab3Zw4q5sEE2COkpfXjoE7o+PmqD9DQW4koUT3roNxwziUdXGnRndMat/LJNUtePwn1TlP4do3uoe3KZQ==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@types/babel__template": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/@types/babel__template/-/babel__template-7.0.2.tgz", + "integrity": "sha512-/K6zCpeW7Imzgab2bLkLEbz0+1JlFSrUMdw7KoIIu+IUdu51GWaBZpd3y1VXGVXzynvGa4DaIaxNZHiON3GXUg==", + "dev": true, + "requires": { + "@babel/parser": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@types/babel__traverse": { + "version": "7.0.6", + "resolved": "https://registry.npmjs.org/@types/babel__traverse/-/babel__traverse-7.0.6.tgz", + "integrity": "sha512-XYVgHF2sQ0YblLRMLNPB3CkFMewzFmlDsH/TneZFHUXDlABQgh88uOxuez7ZcXxayLFrqLwtDH1t+FmlFwNZxw==", + "dev": true, + "requires": { + "@babel/types": "^7.3.0" + } + }, + "@types/istanbul-lib-coverage": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.1.tgz", + "integrity": "sha512-hRJD2ahnnpLgsj6KWMYSrmXkM3rm2Dl1qkx6IOFD5FnuNPXJIG5L0dhgKXCYTRMGzU4n0wImQ/xfmRc4POUFlg==", + "dev": true + }, + "@types/istanbul-lib-report": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-lib-report/-/istanbul-lib-report-1.1.1.tgz", + "integrity": "sha512-3BUTyMzbZa2DtDI2BkERNC6jJw2Mr2Y0oGI7mRxYNBPxppbtEK1F66u3bKwU2g+wxwWI7PAoRpJnOY1grJqzHg==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*" + } + }, + "@types/istanbul-reports": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@types/istanbul-reports/-/istanbul-reports-1.1.1.tgz", + "integrity": "sha512-UpYjBi8xefVChsCoBpKShdxTllC9pwISirfoZsUa2AAdQg/Jd2KQGtSbw+ya7GPo7x/wAPlH6JBhKhAsXUEZNA==", + "dev": true, + "requires": { + "@types/istanbul-lib-coverage": "*", + "@types/istanbul-lib-report": "*" + } + }, "@types/jest": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.0.tgz", - "integrity": "sha512-kOafJnUTnMd7/OfEO/x3I47EHswNjn+dbz9qk3mtonr1RvKT+1FGVxnxAx08I9K8Tl7j9hpoJRE7OCf+t10fng==", + "version": "24.0.13", + "resolved": "https://registry.npmjs.org/@types/jest/-/jest-24.0.13.tgz", + "integrity": "sha512-3m6RPnO35r7Dg+uMLj1+xfZaOgIHHHut61djNjzwExXN4/Pm9has9C6I1KMYSfz7mahDhWUOVg4HW/nZdv5Pww==", + "dev": true, + "requires": { + "@types/jest-diff": "*" + } + }, + "@types/jest-diff": { + "version": "20.0.1", + "resolved": "https://registry.npmjs.org/@types/jest-diff/-/jest-diff-20.0.1.tgz", + "integrity": "sha512-yALhelO3i0hqZwhjtcr6dYyaLoCHbAMshwtj6cGxTvHZAKXHsYGdff6E8EPw3xLKY0ELUTQ69Q1rQiJENnccMA==", "dev": true }, "@types/node": { - "version": "10.12.24", - "resolved": "https://registry.npmjs.org/@types/node/-/node-10.12.24.tgz", - "integrity": "sha512-GWWbvt+z9G5otRBW8rssOFgRY87J9N/qbhqfjMZ+gUuL6zoL+Hm6gP/8qQBG4jjimqdaNLCehcVapZ/Fs2WjCQ==", + "version": "12.0.2", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.2.tgz", + "integrity": "sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==", + "dev": true + }, + "@types/stack-utils": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-1.0.1.tgz", + "integrity": "sha512-l42BggppR6zLmpfU6fq9HEa2oGPEI8yrSPL3GITjfRInppYFahObbIQOQK3UGxEnyQpltZLaPe75046NOZQikw==", + "dev": true + }, + "@types/yargs": { + "version": "12.0.12", + "resolved": "https://registry.npmjs.org/@types/yargs/-/yargs-12.0.12.tgz", + "integrity": "sha512-SOhuU4wNBxhhTHxYaiG5NY4HBhDIDnJF60GU+2LqHAdKKer86//e4yg69aENCtQ04n0ovz+tq2YPME5t5yp4pw==", "dev": true }, "abab": { @@ -301,9 +782,9 @@ "dev": true }, "acorn-globals": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.0.tgz", - "integrity": "sha512-hMtHj3s5RnuhvHPowpBYvJVj3rAar82JiDQHvGs1zO0l10ocX/xEdBShNHTJaboucJUsScghp74pH3s7EnHHQw==", + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/acorn-globals/-/acorn-globals-4.3.2.tgz", + "integrity": "sha512-BbzvZhVtZP+Bs1J1HcwrQe8ycfO0wStkSGxuul3He3GkHOIZ6eTqOkPuw9IP1X3+IkOo4wiJmwkobzXYz4wewQ==", "dev": true, "requires": { "acorn": "^6.0.1", @@ -311,9 +792,9 @@ }, "dependencies": { "acorn": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.0.tgz", - "integrity": "sha512-MW/FjM+IvU9CgBzjO3UIPCE2pyEwUsoFl+VGdczOPEdxfGFjuKny/gN54mOuX7Qxmb9Rg9MCn2oKiSUeW+pjrw==", + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", + "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", "dev": true } } @@ -324,43 +805,34 @@ "integrity": "sha512-OtUw6JUTgxA2QoqqmrmQ7F2NYqiBPi/L2jqHyFtllhOUvXYQXf0Z1CYUinIfyT4bTCGmrA7gX9FvHA81uzCoVw==", "dev": true }, - "ajv": { - "version": "5.5.2", - "resolved": "https://registry.npmjs.org/ajv/-/ajv-5.5.2.tgz", - "integrity": "sha1-c7Xuyj+rZT49P5Qis0GtQiBdyWU=", + "agent-base": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", + "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", "dev": true, "requires": { - "co": "^4.6.0", - "fast-deep-equal": "^1.0.0", - "fast-json-stable-stringify": "^2.0.0", - "json-schema-traverse": "^0.3.0" + "es6-promisify": "^5.0.0" } }, - "align-text": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/align-text/-/align-text-0.1.4.tgz", - "integrity": "sha1-DNkKVhCT810KmSVsIrcGlDP60Rc=", + "ajv": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", + "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", "dev": true, - "optional": true, "requires": { - "kind-of": "^3.0.2", - "longest": "^1.0.1", - "repeat-string": "^1.5.2" + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" } }, - "amdefine": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/amdefine/-/amdefine-1.0.1.tgz", - "integrity": "sha1-SlKCrBZHKek2Gbz9OtFR+BfOkfU=", - "dev": true - }, "ansi-escape-sequences": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/ansi-escape-sequences/-/ansi-escape-sequences-4.0.0.tgz", - "integrity": "sha512-v+0wW9Wezwsyb0uF4aBVCjmSqit3Ru7PZFziGF0o2KwTvN2zWfTi3BRLq9EkJFdg3eBbyERXGTntVpBxH1J68Q==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-escape-sequences/-/ansi-escape-sequences-4.1.0.tgz", + "integrity": "sha512-dzW9kHxH011uBsidTXd14JXgzye/YLb2LzeKZ4bsgl/Knwx8AtbSFkkGxagdNOoh0DlqHCmfiEjWKBaqjOanVw==", "dev": true, "requires": { - "array-back": "^2.0.0" + "array-back": "^3.0.1" } }, "ansi-escapes": { @@ -391,15 +863,6 @@ "normalize-path": "^2.1.1" } }, - "append-transform": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/append-transform/-/append-transform-1.0.0.tgz", - "integrity": "sha512-P009oYkeHyU742iSZJzZZywj4QRJdnTWffaKuJQLablCZ1uz6/cW4yaRgcDaoQ+uwOxxnt0gRUcwfsNP2ri0gw==", - "dev": true, - "requires": { - "default-require-extensions": "^2.0.0" - } - }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", @@ -415,16 +878,6 @@ "integrity": "sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=", "dev": true }, - "argv-tools": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/argv-tools/-/argv-tools-0.1.1.tgz", - "integrity": "sha512-Cc0dBvx4dvrjjKpyDA6w8RlNAw8Su30NvZbWl/Tv9ZALEVlLVkWQiHMi84Q0xNfpVuSaiQbYkdmWK8g1PLGhKw==", - "dev": true, - "requires": { - "array-back": "^2.0.0", - "find-replace": "^2.0.1" - } - }, "arr-diff": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/arr-diff/-/arr-diff-4.0.0.tgz", @@ -444,13 +897,10 @@ "dev": true }, "array-back": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", - "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", - "dev": true, - "requires": { - "typical": "^2.6.1" - } + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-3.1.0.tgz", + "integrity": "sha512-TkuxA4UCOvxuDK6NZYXCalszEzj+TLszyASooky+i742l9TqsOdYCMJJupxRic61hwquNtppB3hgcuq9SVSH1Q==", + "dev": true }, "array-equal": { "version": "1.0.0", @@ -464,12 +914,6 @@ "integrity": "sha1-qJS3XUvE9s1nnvMkSp/Y9Gri1Cg=", "dev": true }, - "arrify": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", - "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", - "dev": true - }, "asn1": { "version": "0.2.4", "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.4.tgz", @@ -497,15 +941,6 @@ "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", "dev": true }, - "async": { - "version": "2.6.1", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.1.tgz", - "integrity": "sha512-fNEiL2+AZt6AlAw/29Cr0UDe4sRAHCpEHh54WMz+Bb7QfNcFw4h3loofyJpLeQs4Yx7yuqu/2dLgM5hKOs6HlQ==", - "dev": true, - "requires": { - "lodash": "^4.17.10" - } - }, "async-limiter": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.0.tgz", @@ -728,13 +1163,16 @@ } }, "babel-jest": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.1.0.tgz", - "integrity": "sha512-MLcagnVrO9ybQGLEfZUqnOzv36iQzU7Bj4elm39vCukumLVSfoX+tRy3/jW7lUKc7XdpRmB/jech6L/UCsSZjw==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-24.8.0.tgz", + "integrity": "sha512-+5/kaZt4I9efoXzPlZASyK/lN9qdRKmmUav9smVc0ruPQD7IsfucQ87gpOE8mn2jbDuS6M/YOW6n3v9ZoIfgnw==", "dev": true, "requires": { + "@jest/transform": "^24.8.0", + "@jest/types": "^24.8.0", + "@types/babel__core": "^7.1.0", "babel-plugin-istanbul": "^5.1.0", - "babel-preset-jest": "^24.1.0", + "babel-preset-jest": "^24.6.0", "chalk": "^2.4.2", "slash": "^2.0.0" }, @@ -795,21 +1233,24 @@ } }, "babel-plugin-istanbul": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.0.tgz", - "integrity": "sha512-CLoXPRSUWiR8yao8bShqZUIC6qLfZVVY3X1wj+QPNXu0wfmrRRfarh1LYy+dYMVI+bDj0ghy3tuqFFRFZmL1Nw==", + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/babel-plugin-istanbul/-/babel-plugin-istanbul-5.1.4.tgz", + "integrity": "sha512-dySz4VJMH+dpndj0wjJ8JPs/7i1TdSPb1nRrn56/92pKOF9VKC1FMFJmMXjzlGGusnCAqujP6PBCiKq0sVA+YQ==", "dev": true, "requires": { "find-up": "^3.0.0", - "istanbul-lib-instrument": "^3.0.0", - "test-exclude": "^5.0.0" + "istanbul-lib-instrument": "^3.3.0", + "test-exclude": "^5.2.3" } }, "babel-plugin-jest-hoist": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.1.0.tgz", - "integrity": "sha512-gljYrZz8w1b6fJzKcsfKsipSru2DU2DmQ39aB6nV3xQ0DDv3zpIzKGortA5gknrhNnPN8DweaEgrnZdmbGmhnw==", - "dev": true + "version": "24.6.0", + "resolved": "https://registry.npmjs.org/babel-plugin-jest-hoist/-/babel-plugin-jest-hoist-24.6.0.tgz", + "integrity": "sha512-3pKNH6hMt9SbOv0F3WVmy5CWQ4uogS3k0GY5XLyQHJ9EGpAT9XWkFd2ZiXXtkwFHdAHa5j7w7kfxSP5lAIwu7w==", + "dev": true, + "requires": { + "@types/babel__traverse": "^7.0.6" + } }, "babel-plugin-syntax-async-functions": { "version": "6.13.0", @@ -1143,13 +1584,13 @@ } }, "babel-preset-jest": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-24.1.0.tgz", - "integrity": "sha512-FfNLDxFWsNX9lUmtwY7NheGlANnagvxq8LZdl5PKnVG3umP+S/g0XbVBfwtA4Ai3Ri/IMkWabBz3Tyk9wdspcw==", + "version": "24.6.0", + "resolved": "https://registry.npmjs.org/babel-preset-jest/-/babel-preset-jest-24.6.0.tgz", + "integrity": "sha512-pdZqLEdmy1ZK5kyRUfvBb2IfTPb2BUvIJczlPspS8fWmBQslNNDBqVfh7BW5leOVJMDZKzjD8XEyABTk6gQ5yw==", "dev": true, "requires": { "@babel/plugin-syntax-object-rest-spread": "^7.0.0", - "babel-plugin-jest-hoist": "^24.1.0" + "babel-plugin-jest-hoist": "^24.6.0" } }, "babel-register": { @@ -1297,15 +1738,14 @@ "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", "integrity": "sha1-pDAdOJtqQ/m2f/PKEaP2Y342Dp4=", "dev": true, - "optional": true, "requires": { "tweetnacl": "^0.14.3" } }, "bluebird": { - "version": "3.5.1", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.1.tgz", - "integrity": "sha512-MKiLiV+I1AA596t9w1sQJ8jkiSr5+ZKi0WKrYGUn6d1Fx+Ij4tIj+m2WMQSGczs5jZVxV339chE8iwk6F64wjA==", + "version": "3.5.5", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.5.5.tgz", + "integrity": "sha512-5am6HnnfN+urzt4yfg7IgTbotDjIT/u8AJpEt0sIU9FtXfVeezXAPKswrG+xKUCOYAINpSdgZVDU6QFh+cuH3w==", "dev": true }, "brace-expansion": { @@ -1360,6 +1800,14 @@ "dev": true, "requires": { "resolve": "1.1.7" + }, + "dependencies": { + "resolve": { + "version": "1.1.7", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", + "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", + "dev": true + } } }, "browserslist": { @@ -1428,21 +1876,25 @@ "array-back": "^2.0.0", "fs-then-native": "^2.0.0", "mkdirp2": "^1.0.3" + }, + "dependencies": { + "array-back": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", + "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", + "dev": true, + "requires": { + "typical": "^2.6.1" + } + } } }, "callsites": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.0.0.tgz", - "integrity": "sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw==", + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", "dev": true }, - "camelcase": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-1.2.1.tgz", - "integrity": "sha1-m7UwTS4LVmmLLHWLCKPqqdqlijk=", - "dev": true, - "optional": true - }, "caniuse-lite": { "version": "1.0.30000865", "resolved": "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30000865.tgz", @@ -1450,12 +1902,12 @@ "dev": true }, "capture-exit": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-1.2.0.tgz", - "integrity": "sha1-HF/MSJ/QqwDU8ax64QcuMXP7q28=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/capture-exit/-/capture-exit-2.0.0.tgz", + "integrity": "sha512-PiT/hQmTonHhl/HFGN+Lx3JJUznrVYJ3+AQsnthneZbvW7x+f08Tk7yLJTLEOUvBTbduLeeBkxEaYXUOUrRq6g==", "dev": true, "requires": { - "rsvp": "^3.3.3" + "rsvp": "^4.8.4" } }, "caseless": { @@ -1465,23 +1917,20 @@ "dev": true }, "catharsis": { - "version": "0.8.9", - "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.9.tgz", - "integrity": "sha1-mMyJDKZS3S7w5ws3klMQ/56Q/Is=", - "dev": true, - "requires": { - "underscore-contrib": "~0.3.0" - } - }, - "center-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/center-align/-/center-align-0.1.3.tgz", - "integrity": "sha1-qg0yYptu6XIgBBHL1EYckHvCt60=", + "version": "0.8.10", + "resolved": "https://registry.npmjs.org/catharsis/-/catharsis-0.8.10.tgz", + "integrity": "sha512-l2OUaz/3PU3MZylspVFJvwHCVfWyvcduPq4lv3AzZ2pJzZCo7kNKFNyatwujD7XgvGkNAE/Jhhbh2uARNwNkfw==", "dev": true, - "optional": true, "requires": { - "align-text": "^0.1.3", - "lazy-cache": "^1.0.3" + "lodash": "^4.17.11" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } } }, "chalk": { @@ -1526,27 +1975,6 @@ } } }, - "cliui": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-2.1.0.tgz", - "integrity": "sha1-S0dXYP+AJkx2LDoXGQMukcf+oNE=", - "dev": true, - "optional": true, - "requires": { - "center-align": "^0.1.1", - "right-align": "^0.1.1", - "wordwrap": "0.0.2" - }, - "dependencies": { - "wordwrap": { - "version": "0.0.2", - "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.2.tgz", - "integrity": "sha1-t5Zpu0LstAn4PVg8rVLKF+qhZD8=", - "dev": true, - "optional": true - } - } - }, "co": { "version": "4.6.0", "resolved": "https://registry.npmjs.org/co/-/co-4.6.0.tgz", @@ -1560,15 +1988,15 @@ "dev": true }, "codecov": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.1.0.tgz", - "integrity": "sha512-aWQc/rtHbcWEQLka6WmBAOpV58J2TwyXqlpAQGhQaSiEUoigTTUk6lLd2vB3kXkhnDyzyH74RXfmV4dq2txmdA==", + "version": "3.5.0", + "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.5.0.tgz", + "integrity": "sha512-/OsWOfIHaQIr7aeZ4pY0UC1PZT6kimoKFOFYFNb6wxo3iw12nRrh+mNGH72rnXxNsq6SGfesVPizm/6Q3XqcFQ==", "dev": true, "requires": { "argv": "^0.0.2", "ignore-walk": "^3.0.1", - "js-yaml": "^3.12.0", - "request": "^2.87.0", + "js-yaml": "^3.13.1", + "teeny-request": "^3.11.3", "urlgrey": "^0.4.4" } }, @@ -1608,25 +2036,32 @@ "dev": true }, "combined-stream": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.7.tgz", - "integrity": "sha512-brWl9y6vOB1xYPZcpZde3N9zDByXTosAeMDo4p1wzo6UMOX4vumB+TP1RZ76sfE6Md68Q0NJSrE/gbezd4Ul+w==", + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", "dev": true, "requires": { "delayed-stream": "~1.0.0" } }, "command-line-args": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.0.2.tgz", - "integrity": "sha512-/qPcbL8zpqg53x4rAaqMFlRV4opN3pbla7I7k9x8kyOBMQoGT6WltjN6sXZuxOXw6DgdK7Ad+ijYS5gjcr7vlA==", + "version": "5.1.1", + "resolved": "https://registry.npmjs.org/command-line-args/-/command-line-args-5.1.1.tgz", + "integrity": "sha512-hL/eG8lrll1Qy1ezvkant+trihbGnaKaeEjj6Scyr3DN+RC7iQ5Rz84IeLERfAWDGo0HBSNAakczwgCilDXnWg==", "dev": true, "requires": { - "argv-tools": "^0.1.1", - "array-back": "^2.0.0", - "find-replace": "^2.0.1", + "array-back": "^3.0.1", + "find-replace": "^3.0.0", "lodash.camelcase": "^4.3.0", - "typical": "^2.6.1" + "typical": "^4.0.0" + }, + "dependencies": { + "typical": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/typical/-/typical-4.0.0.tgz", + "integrity": "sha512-VAH4IvQ7BDFYglMd7BPRDfLgxZZX4O4TFcRDA6EN5X7erNJJq+McIEp8np9aVtxrCJ6qx4GTYVfOWNjcqwZgRw==", + "dev": true + } } }, "command-line-tool": { @@ -1640,6 +2075,17 @@ "command-line-args": "^5.0.0", "command-line-usage": "^4.1.0", "typical": "^2.6.1" + }, + "dependencies": { + "array-back": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", + "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", + "dev": true, + "requires": { + "typical": "^2.6.1" + } + } } }, "command-line-usage": { @@ -1652,12 +2098,23 @@ "array-back": "^2.0.0", "table-layout": "^0.4.2", "typical": "^2.6.1" + }, + "dependencies": { + "array-back": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", + "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", + "dev": true, + "requires": { + "typical": "^2.6.1" + } + } } }, "commander": { - "version": "2.19.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.19.0.tgz", - "integrity": "sha512-6tvAOO+D6OENvRAh524Dh9jcfKTYDQAqvqezbCW82xj5X0pSrcpxtvRKHLG0yBY6SD7PSDrJaj+0AiOcKVd1Xg==", + "version": "2.20.0", + "resolved": "https://registry.npmjs.org/commander/-/commander-2.20.0.tgz", + "integrity": "sha512-7j2y+40w61zy6YC2iRNpUe/NwhNyoXrYpHMrSunaMG64nRnaf96zO/KMQR4OyN/UnE5KLyEBnKHd4aG3rskjpQ==", "dev": true }, "common-sequence": { @@ -1666,16 +2123,10 @@ "integrity": "sha1-MOB/P49vf5s97oVPILLTnu4Ibeg=", "dev": true }, - "compare-versions": { - "version": "3.4.0", - "resolved": "https://registry.npmjs.org/compare-versions/-/compare-versions-3.4.0.tgz", - "integrity": "sha512-tK69D7oNXXqUW3ZNo/z7NXTEz22TCF0pTE+YF9cxvaAM9XnkLo1fV621xCLrRR6aevJlKxExkss0vWqUCUpqdg==", - "dev": true - }, "component-emitter": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/component-emitter/-/component-emitter-1.2.1.tgz", - "integrity": "sha1-E3kY1teCg/ffemt8WmPhQOaUJeY=", + "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 }, "concat-map": { @@ -1755,9 +2206,9 @@ "dev": true }, "cssstyle": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.1.1.tgz", - "integrity": "sha512-364AI1l/M5TYcFH83JnOH/pSqgaNnKmYgKrm0didZMGKWjQB60dymwWy1rKUgL3J1ffdq9xVi2yGLHdSjjSNog==", + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/cssstyle/-/cssstyle-1.2.2.tgz", + "integrity": "sha512-43wY3kl1CVQSvL7wUY1qXkxVGkStjpkDmVjiIKX8R97uhajy8Bybay78uOtqvh7Q5GK75dNPfW0geWjE6qQQow==", "dev": true, "requires": { "cssom": "0.3.x" @@ -1829,15 +2280,6 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, - "default-require-extensions": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/default-require-extensions/-/default-require-extensions-2.0.0.tgz", - "integrity": "sha1-9fj7sYp9bVCyH2QfZJ67Uiz+JPc=", - "dev": true, - "requires": { - "strip-bom": "^3.0.0" - } - }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", @@ -1922,29 +2364,37 @@ "dev": true }, "diff-sequences": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.0.0.tgz", - "integrity": "sha512-46OkIuVGBBnrC0soO/4LHu5LHGHx0uhP65OVz8XOrAJpqiCB2aVIuESvjI1F9oqebuvY8lekS1pt6TN7vt7qsw==", + "version": "24.3.0", + "resolved": "https://registry.npmjs.org/diff-sequences/-/diff-sequences-24.3.0.tgz", + "integrity": "sha512-xLqpez+Zj9GKSnPWS0WZw1igGocZ+uua8+y+5dDNTT934N3QuY1sp2LkHzwiaYQGz60hMq0pjAshdeXm5VUOEw==", "dev": true }, "dmd": { - "version": "3.0.12", - "resolved": "https://registry.npmjs.org/dmd/-/dmd-3.0.12.tgz", - "integrity": "sha512-79w644JdsB2TthYpVl2bDurX7i9Abaegg2E7X46Ajc135aASTMXxrHzJ9mOa5X5nbmnXwlBYiF68K+1baX+BzQ==", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/dmd/-/dmd-4.0.0.tgz", + "integrity": "sha512-J+4CgbQiMuJHiU9dvTVN8iOOZGeR3bef1wBqz6eVvvX17jkpkKVd8TeeutA/FJAeFbLQfXnyQ3o4qY7W+c5cxQ==", "dev": true, "requires": { - "array-back": "^2.0.0", + "array-back": "^3.1.0", "cache-point": "^0.4.1", "common-sequence": "^1.0.2", "file-set": "^2.0.0", - "handlebars": "^4.0.11", - "marked": "^0.3.16", + "handlebars": "^4.1.2", + "marked": "^0.6.2", "object-get": "^2.1.0", - "reduce-flatten": "^1.0.1", - "reduce-unique": "^1.0.0", + "reduce-flatten": "^2.0.0", + "reduce-unique": "^2.0.1", "reduce-without": "^1.0.1", "test-value": "^3.0.0", - "walk-back": "^3.0.0" + "walk-back": "^3.0.1" + }, + "dependencies": { + "reduce-flatten": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/reduce-flatten/-/reduce-flatten-2.0.0.tgz", + "integrity": "sha512-EJ4UNY/U1t2P/2k6oqotuX2Cc3T6nxJwsM0N0asT7dhrtH1ltUxDn4NalSYmPE2rCkVpcf/X6R0wDwcFpzhd4w==", + "dev": true + } } }, "domexception": { @@ -1961,7 +2411,6 @@ "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", "integrity": "sha1-OoOpBOVDUyh4dMVkt1SThoSamMk=", "dev": true, - "optional": true, "requires": { "jsbn": "~0.1.0", "safer-buffer": "^2.1.0" @@ -1982,6 +2431,12 @@ "once": "^1.4.0" } }, + "entities": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/entities/-/entities-1.1.2.tgz", + "integrity": "sha512-f2LZMYl1Fzu7YSBKg+RoROelpOaNrcGmE9AZubeDfrCEia483oW4MI4VyFd5VNHIgQ/7qm1I0wUHK1eJnn2y2w==", + "dev": true + }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", @@ -2016,6 +2471,21 @@ "is-symbol": "^1.0.2" } }, + "es6-promise": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz", + "integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==", + "dev": true + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "dev": true, + "requires": { + "es6-promise": "^4.0.3" + } + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -2023,9 +2493,9 @@ "dev": true }, "escodegen": { - "version": "1.11.0", - "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.0.tgz", - "integrity": "sha512-IeMV45ReixHS53K/OmfKAIztN/igDHzTJUhZM3k1jMhIZWjk45SMwAtBsEXiJp3vSPmTcu6CXn7mDvFHRN66fw==", + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.11.1.tgz", + "integrity": "sha512-JwiqFD9KdGVVpeuRa68yU3zZnBEOcPs0nKW7wZzXky8Z7tffdYUHbe11bPCV5jYlK6DVdKLWLm0f5I/QlL0Kmw==", "dev": true, "requires": { "esprima": "^3.1.3", @@ -2069,13 +2539,10 @@ "dev": true }, "exec-sh": { - "version": "0.2.2", - "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.2.2.tgz", - "integrity": "sha512-FIUCJz1RbuS0FKTdaAafAByGS0CPvU3R0MeHxgtl+djzCc//F8HakL8GzmVNZanasTbTAY/3DRFA0KpVqj/eAw==", - "dev": true, - "requires": { - "merge": "^1.2.0" - } + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/exec-sh/-/exec-sh-0.3.2.tgz", + "integrity": "sha512-9sLAvzhI5nc8TpuQUh4ahMdCrWT00wPWz7j47/emR5+2qEfoZP5zzUXvx+vdx+H6ohhnsYC31iX04QLYJK8zTg==", + "dev": true }, "execa": { "version": "1.0.0", @@ -2149,16 +2616,17 @@ } }, "expect": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/expect/-/expect-24.1.0.tgz", - "integrity": "sha512-lVcAPhaYkQcIyMS+F8RVwzbm1jro20IG8OkvxQ6f1JfqhVZyyudCwYogQ7wnktlf14iF3ii7ArIUO/mqvrW9Gw==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/expect/-/expect-24.8.0.tgz", + "integrity": "sha512-/zYvP8iMDrzaaxHVa724eJBCKqSHmO0FA7EDkBiRHxg6OipmMn1fN+C8T9L9K8yr7UONkOifu6+LLH+z76CnaA==", "dev": true, "requires": { + "@jest/types": "^24.8.0", "ansi-styles": "^3.2.0", - "jest-get-type": "^24.0.0", - "jest-matcher-utils": "^24.0.0", - "jest-message-util": "^24.0.0", - "jest-regex-util": "^24.0.0" + "jest-get-type": "^24.8.0", + "jest-matcher-utils": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-regex-util": "^24.3.0" }, "dependencies": { "ansi-styles": { @@ -2277,9 +2745,9 @@ "dev": true }, "fast-deep-equal": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-1.1.0.tgz", - "integrity": "sha1-wFNHeBfIa1HaqFPIHgWbcz0CNhQ=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", "dev": true }, "fast-json-stable-stringify": { @@ -2304,23 +2772,38 @@ } }, "file-set": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/file-set/-/file-set-2.0.0.tgz", - "integrity": "sha512-cCWXfw+nrYoIoUVmEF7Xsw91lGWuObtSnTEZ7AmdvZou1A/6Xx237HfxdQyC/ayKRvQSMbNOBwg62OjN5JxbXw==", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/file-set/-/file-set-2.0.1.tgz", + "integrity": "sha512-XgOUUpgR6FbbfYcniLw0qm1Am7PnNYIAkd+eXxRt42LiYhjaso0WiuQ+VmrNdtwotyM+cLCfZ56AZrySP3QnKA==", "dev": true, "requires": { "array-back": "^2.0.0", - "glob": "^7.1.2" - } - }, - "fileset": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/fileset/-/fileset-2.0.3.tgz", - "integrity": "sha1-jnVIqW08wjJ+5eZ0FocjozO7oqA=", - "dev": true, - "requires": { - "glob": "^7.0.3", - "minimatch": "^3.0.3" + "glob": "^7.1.3" + }, + "dependencies": { + "array-back": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", + "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", + "dev": true, + "requires": { + "typical": "^2.6.1" + } + }, + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } } }, "fill-range": { @@ -2347,13 +2830,12 @@ } }, "find-replace": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-2.0.1.tgz", - "integrity": "sha512-LzDo3Fpa30FLIBsh6DCDnMN1KW2g4QKkqKmejlImgWY67dDFPX/x9Kh/op/GK522DchQXEvDi/wD48HKW49XOQ==", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-replace/-/find-replace-3.0.0.tgz", + "integrity": "sha512-6Tb2myMioCAgv5kfvP5/PkZZ/ntTpVK39fHY7WkWBgvbeE+VHd/tZuZ4mrC+bxh4cfOZeYKVPaJIZtZXV7GNCQ==", "dev": true, "requires": { - "array-back": "^2.0.0", - "test-value": "^3.0.0" + "array-back": "^3.0.1" } }, "find-up": { @@ -2378,25 +2860,14 @@ "dev": true }, "form-data": { - "version": "2.3.2", - "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.2.tgz", - "integrity": "sha1-SXBJi+YEwgwAXU9cI67NIda0kJk=", + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", "dev": true, "requires": { "asynckit": "^0.4.0", - "combined-stream": "1.0.6", + "combined-stream": "^1.0.6", "mime-types": "^2.1.12" - }, - "dependencies": { - "combined-stream": { - "version": "1.0.6", - "resolved": "http://registry.npmjs.org/combined-stream/-/combined-stream-1.0.6.tgz", - "integrity": "sha1-cj599ugBrFYTETp+RFqbactjKBg=", - "dev": true, - "requires": { - "delayed-stream": "~1.0.0" - } - } } }, "fragment-cache": { @@ -2409,9 +2880,9 @@ } }, "fs-extra": { - "version": "7.0.1", - "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-7.0.1.tgz", - "integrity": "sha512-YJDaCJZEnBmcbw13fvdAM9AwNOJwOzrE4pqMqBq5nFiEqXUqHwlK4B+3pUw6JNvfSPtX05xFHtYy/1ni01eGCw==", + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-8.0.1.tgz", + "integrity": "sha512-W+XLrggcDzlle47X/XnS7FXrXu9sDo+Ze9zpndeBxdgv88FHLm1HtmkhEwavruS6koanBjp098rUpHs65EmG7A==", "dev": true, "requires": { "graceful-fs": "^4.1.2", @@ -2438,14 +2909,14 @@ "dev": true }, "fsevents": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.7.tgz", - "integrity": "sha512-Pxm6sI2MeBD7RdD12RYsqaP0nMiwx8eZBXCa6z2L+mRHm2DYrOYwihmhjpkdjUHwQhslWQjRpEgNq4XvBmaAuw==", + "version": "1.2.9", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-1.2.9.tgz", + "integrity": "sha512-oeyj2H3EjjonWcFjD5NvZNE9Rqe4UW+nQBU2HNeKw0koVLEFIhtyETyAakeAM3de7Z/SW5kcA+fZUait9EApnw==", "dev": true, "optional": true, "requires": { - "nan": "^2.9.2", - "node-pre-gyp": "^0.10.0" + "nan": "^2.12.1", + "node-pre-gyp": "^0.12.0" }, "dependencies": { "abbrev": { @@ -2523,12 +2994,12 @@ "optional": true }, "debug": { - "version": "2.6.9", + "version": "4.1.1", "bundled": true, "dev": true, "optional": true, "requires": { - "ms": "2.0.0" + "ms": "^2.1.1" } }, "deep-extend": { @@ -2699,24 +3170,24 @@ } }, "ms": { - "version": "2.0.0", + "version": "2.1.1", "bundled": true, "dev": true, "optional": true }, "needle": { - "version": "2.2.4", + "version": "2.3.0", "bundled": true, "dev": true, "optional": true, "requires": { - "debug": "^2.1.2", + "debug": "^4.1.0", "iconv-lite": "^0.4.4", "sax": "^1.2.4" } }, "node-pre-gyp": { - "version": "0.10.3", + "version": "0.12.0", "bundled": true, "dev": true, "optional": true, @@ -2744,13 +3215,13 @@ } }, "npm-bundled": { - "version": "1.0.5", + "version": "1.0.6", "bundled": true, "dev": true, "optional": true }, "npm-packlist": { - "version": "1.2.0", + "version": "1.4.1", "bundled": true, "dev": true, "optional": true, @@ -2889,7 +3360,7 @@ "optional": true }, "semver": { - "version": "5.6.0", + "version": "5.7.0", "bundled": true, "dev": true, "optional": true @@ -3054,65 +3525,22 @@ "dev": true }, "handlebars": { - "version": "4.0.11", - "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.0.11.tgz", - "integrity": "sha1-Ywo13+ApS8KB7a5v/F0yn8eYLcw=", + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", + "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", "dev": true, "requires": { - "async": "^1.4.0", + "neo-async": "^2.6.0", "optimist": "^0.6.1", - "source-map": "^0.4.4", - "uglify-js": "^2.6" + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" }, "dependencies": { - "async": { - "version": "1.5.2", - "resolved": "https://registry.npmjs.org/async/-/async-1.5.2.tgz", - "integrity": "sha1-7GphrlZIDAw8skHJVhjiCJL5Zyo=", - "dev": true - }, "source-map": { - "version": "0.4.4", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.4.4.tgz", - "integrity": "sha1-66T12pwNyZneaAMti092FzZSA2s=", - "dev": true, - "requires": { - "amdefine": ">=0.0.4" - } - }, - "uglify-js": { - "version": "2.8.29", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-2.8.29.tgz", - "integrity": "sha1-KcVzMUgFe7Th913zW3qcty5qWd0=", - "dev": true, - "optional": true, - "requires": { - "source-map": "~0.5.1", - "uglify-to-browserify": "~1.0.0", - "yargs": "~3.10.0" - }, - "dependencies": { - "source-map": { - "version": "0.5.7", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", - "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", - "dev": true, - "optional": true - } - } - }, - "yargs": { - "version": "3.10.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-3.10.0.tgz", - "integrity": "sha1-9+572FfdfB0tOMDnTvvWgdFDH9E=", - "dev": true, - "optional": true, - "requires": { - "camelcase": "^1.0.2", - "cliui": "^2.1.0", - "decamelize": "^1.0.0", - "window-size": "0.1.0" - } + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true } } }, @@ -3123,12 +3551,12 @@ "dev": true }, "har-validator": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.0.tgz", - "integrity": "sha512-+qnmNjI4OfH2ipQ9VQOw23bBd/ibtfbVdK2fYbY4acTDqKTW/YDp9McimZdDbG8iV9fZizUqQMD5xvriB146TA==", + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.3.tgz", + "integrity": "sha512-sNvOCzEQNr/qrvJgc3UG/kD4QtlHycrzwS+6mfTrrSq97BvaYcPZZI1ZSqGSPR73Cxn4LKTD4PttRwfU7jWq5g==", "dev": true, "requires": { - "ajv": "^5.3.0", + "ajv": "^6.5.5", "har-schema": "^2.0.0" } }, @@ -3230,6 +3658,33 @@ "sshpk": "^1.7.0" } }, + "https-proxy-agent": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", + "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", + "dev": true, + "requires": { + "agent-base": "^4.1.0", + "debug": "^3.1.0" + }, + "dependencies": { + "debug": { + "version": "3.2.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-3.2.6.tgz", + "integrity": "sha512-mel+jf7nrtEl5Pn1Qx46zARXKDpBbvzezse7p7LqINmdoIk8PYP5SySaxEmYv6TZ0JyEKA1hsCId6DIhgITtWQ==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -3387,9 +3842,9 @@ "dev": true }, "is-generator-fn": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.0.0.tgz", - "integrity": "sha512-elzyIdM7iKoFHzcrndIqjYomImhxrFRnGP3galODoII4TB9gI7mZ+FnlLQmmjf27SxHS2gKEeyhX5/+YRS6H9g==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-generator-fn/-/is-generator-fn-2.1.0.tgz", + "integrity": "sha512-cTIB4yPYL/Grw0EaSzASzg6bBy9gqCofvWN8okThAYIxKJZC+udlRAmGbM0XLeniEJSs8uEgHPGuHSe1XsOLSQ==", "dev": true }, "is-number": { @@ -3476,66 +3931,44 @@ "integrity": "sha1-R+Y/evVa+m+S4VAOaQ64uFKcCZo=", "dev": true }, - "istanbul-api": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/istanbul-api/-/istanbul-api-2.1.0.tgz", - "integrity": "sha512-+Ygg4t1StoiNlBGc6x0f8q/Bv26FbZqP/+jegzfNpU7Q8o+4ZRoJxJPhBkgE/UonpAjtxnE4zCZIyJX+MwLRMQ==", - "dev": true, - "requires": { - "async": "^2.6.1", - "compare-versions": "^3.2.1", - "fileset": "^2.0.3", - "istanbul-lib-coverage": "^2.0.3", - "istanbul-lib-hook": "^2.0.3", - "istanbul-lib-instrument": "^3.1.0", - "istanbul-lib-report": "^2.0.4", - "istanbul-lib-source-maps": "^3.0.2", - "istanbul-reports": "^2.1.0", - "js-yaml": "^3.12.0", - "make-dir": "^1.3.0", - "minimatch": "^3.0.4", - "once": "^1.4.0" - } - }, "istanbul-lib-coverage": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", - "integrity": "sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw==", + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.5.tgz", + "integrity": "sha512-8aXznuEPCJvGnMSRft4udDRDtb1V3pkQkMMI5LI+6HuQz5oQ4J2UFn1H82raA3qJtyOLkkwVqICBQkjnGtn5mA==", "dev": true }, - "istanbul-lib-hook": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/istanbul-lib-hook/-/istanbul-lib-hook-2.0.3.tgz", - "integrity": "sha512-CLmEqwEhuCYtGcpNVJjLV1DQyVnIqavMLFHV/DP+np/g3qvdxu3gsPqYoJMXm15sN84xOlckFB3VNvRbf5yEgA==", - "dev": true, - "requires": { - "append-transform": "^1.0.0" - } - }, "istanbul-lib-instrument": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.1.0.tgz", - "integrity": "sha512-ooVllVGT38HIk8MxDj/OIHXSYvH+1tq/Vb38s8ixt9GoJadXska4WkGY+0wkmtYCZNYtaARniH/DixUGGLZ0uA==", - "dev": true, - "requires": { - "@babel/generator": "^7.0.0", - "@babel/parser": "^7.0.0", - "@babel/template": "^7.0.0", - "@babel/traverse": "^7.0.0", - "@babel/types": "^7.0.0", - "istanbul-lib-coverage": "^2.0.3", - "semver": "^5.5.0" + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.3.0.tgz", + "integrity": "sha512-5nnIN4vo5xQZHdXno/YDXJ0G+I3dAm4XgzfSVTPLQpj/zAV2dV6Juy0yaf10/zrJOJeHoN3fraFe+XRq2bFVZA==", + "dev": true, + "requires": { + "@babel/generator": "^7.4.0", + "@babel/parser": "^7.4.3", + "@babel/template": "^7.4.0", + "@babel/traverse": "^7.4.3", + "@babel/types": "^7.4.0", + "istanbul-lib-coverage": "^2.0.5", + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.1.0.tgz", + "integrity": "sha512-kCqEOOHoBcFs/2Ccuk4Xarm/KiWRSLEX9CAZF8xkJ6ZPlIoTZ8V5f7J16vYLJqDbR7KrxTJpR2lqjIEm2Qx9cQ==", + "dev": true + } } }, "istanbul-lib-report": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.4.tgz", - "integrity": "sha512-sOiLZLAWpA0+3b5w5/dq0cjm2rrNdAfHWaGhmn7XEFW6X++IV9Ohn+pnELAl9K3rfpaeBfbmH9JU5sejacdLeA==", + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/istanbul-lib-report/-/istanbul-lib-report-2.0.8.tgz", + "integrity": "sha512-fHBeG573EIihhAblwgxrSenp0Dby6tJMFR/HvlerBsrCTD5bkUuoNtn3gVh29ZCS824cGGBPn7Sg7cNk+2xUsQ==", "dev": true, "requires": { - "istanbul-lib-coverage": "^2.0.3", - "make-dir": "^1.3.0", - "supports-color": "^6.0.0" + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "supports-color": "^6.1.0" }, "dependencies": { "supports-color": { @@ -3550,15 +3983,15 @@ } }, "istanbul-lib-source-maps": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.2.tgz", - "integrity": "sha512-JX4v0CiKTGp9fZPmoxpu9YEkPbEqCqBbO3403VabKjH+NRXo72HafD5UgnjTEqHL2SAjaZK1XDuDOkn6I5QVfQ==", + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/istanbul-lib-source-maps/-/istanbul-lib-source-maps-3.0.6.tgz", + "integrity": "sha512-R47KzMtDJH6X4/YW9XTx+jrLnZnscW4VpNN+1PViSYTejLVPWv7oov+Duf8YQSPyVRUvueQqz1TcsC6mooZTXw==", "dev": true, "requires": { "debug": "^4.1.1", - "istanbul-lib-coverage": "^2.0.3", - "make-dir": "^1.3.0", - "rimraf": "^2.6.2", + "istanbul-lib-coverage": "^2.0.5", + "make-dir": "^2.1.0", + "rimraf": "^2.6.3", "source-map": "^0.6.1" }, "dependencies": { @@ -3586,30 +4019,44 @@ } }, "istanbul-reports": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.1.0.tgz", - "integrity": "sha512-azQdSX+dtTtkQEfqq20ICxWi6eOHXyHIgMFw1VOOVi8iIPWeCWRgCyFh/CsBKIhcgskMI8ExXmU7rjXTRCIJ+A==", + "version": "2.2.6", + "resolved": "https://registry.npmjs.org/istanbul-reports/-/istanbul-reports-2.2.6.tgz", + "integrity": "sha512-SKi4rnMyLBKe0Jy2uUdx28h8oG7ph2PPuQPvIAh31d+Ci+lSiEu4C+h3oBPuJ9+mPKhOyW0M8gY4U5NM1WLeXA==", "dev": true, "requires": { - "handlebars": "^4.0.11" + "handlebars": "^4.1.2" + }, + "dependencies": { + "handlebars": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/handlebars/-/handlebars-4.1.2.tgz", + "integrity": "sha512-nvfrjqvt9xQ8Z/w0ijewdD/vvWDTOweBUm96NTr66Wfvo1mJenBLwcYmPs3TIBP5ruzYGD7Hx/DaM9RmhroGPw==", + "dev": true, + "requires": { + "neo-async": "^2.6.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" + } + }, + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } } }, "jest": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/jest/-/jest-24.1.0.tgz", - "integrity": "sha512-+q91L65kypqklvlRFfXfdzUKyngQLOcwGhXQaLmVHv+d09LkNXuBuGxlofTFW42XMzu3giIcChchTsCNUjQ78A==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest/-/jest-24.8.0.tgz", + "integrity": "sha512-o0HM90RKFRNWmAWvlyV8i5jGZ97pFwkeVoGvPW1EtLTgJc2+jcuqcbbqcSZLE/3f2S5pt0y2ZBETuhpWNl1Reg==", "dev": true, "requires": { "import-local": "^2.0.0", - "jest-cli": "^24.1.0" + "jest-cli": "^24.8.0" }, "dependencies": { - "ansi-regex": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", - "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", - "dev": true - }, "ansi-styles": { "version": "3.2.1", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", @@ -3630,73 +4077,27 @@ "supports-color": "^5.3.0" } }, - "graceful-fs": { - "version": "4.1.15", - "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", - "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", - "dev": true - }, "jest-cli": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.1.0.tgz", - "integrity": "sha512-U/iyWPwOI0T1CIxVLtk/2uviOTJ/OiSWJSe8qt6X1VkbbgP+nrtLJlmT9lPBe4lK78VNFJtrJ7pttcNv/s7yCw==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-cli/-/jest-cli-24.8.0.tgz", + "integrity": "sha512-+p6J00jSMPQ116ZLlHJJvdf8wbjNbZdeSX9ptfHX06/MSNaXmKihQzx5vQcw0q2G6JsdVkUIdWbOWtSnaYs3yA==", "dev": true, "requires": { - "ansi-escapes": "^3.0.0", + "@jest/core": "^24.8.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", "chalk": "^2.0.1", "exit": "^0.1.2", - "glob": "^7.1.2", - "graceful-fs": "^4.1.15", "import-local": "^2.0.0", "is-ci": "^2.0.0", - "istanbul-api": "^2.0.8", - "istanbul-lib-coverage": "^2.0.2", - "istanbul-lib-instrument": "^3.0.1", - "istanbul-lib-source-maps": "^3.0.1", - "jest-changed-files": "^24.0.0", - "jest-config": "^24.1.0", - "jest-environment-jsdom": "^24.0.0", - "jest-get-type": "^24.0.0", - "jest-haste-map": "^24.0.0", - "jest-message-util": "^24.0.0", - "jest-regex-util": "^24.0.0", - "jest-resolve-dependencies": "^24.1.0", - "jest-runner": "^24.1.0", - "jest-runtime": "^24.1.0", - "jest-snapshot": "^24.1.0", - "jest-util": "^24.0.0", - "jest-validate": "^24.0.0", - "jest-watcher": "^24.0.0", - "jest-worker": "^24.0.0", - "micromatch": "^3.1.10", - "node-notifier": "^5.2.1", - "p-each-series": "^1.0.0", - "pirates": "^4.0.0", + "jest-config": "^24.8.0", + "jest-util": "^24.8.0", + "jest-validate": "^24.8.0", "prompts": "^2.0.1", - "realpath-native": "^1.0.0", - "rimraf": "^2.5.4", - "slash": "^2.0.0", - "string-length": "^2.0.0", - "strip-ansi": "^5.0.0", - "which": "^1.2.12", + "realpath-native": "^1.1.0", "yargs": "^12.0.2" } }, - "slash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", - "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", - "dev": true - }, - "strip-ansi": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", - "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", - "dev": true, - "requires": { - "ansi-regex": "^4.0.0" - } - }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -3709,36 +4110,39 @@ } }, "jest-changed-files": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-24.0.0.tgz", - "integrity": "sha512-nnuU510R9U+UX0WNb5XFEcsrMqriSiRLeO9KWDFgPrpToaQm60prfQYpxsXigdClpvNot5bekDY440x9dNGnsQ==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-changed-files/-/jest-changed-files-24.8.0.tgz", + "integrity": "sha512-qgANC1Yrivsq+UrLXsvJefBKVoCsKB0Hv+mBb6NMjjZ90wwxCDmU3hsCXBya30cH+LnPYjwgcU65i6yJ5Nfuug==", "dev": true, "requires": { + "@jest/types": "^24.8.0", "execa": "^1.0.0", "throat": "^4.0.0" } }, "jest-config": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-24.1.0.tgz", - "integrity": "sha512-FbbRzRqtFC6eGjG5VwsbW4E5dW3zqJKLWYiZWhB0/4E5fgsMw8GODLbGSrY5t17kKOtCWb/Z7nsIThRoDpuVyg==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-config/-/jest-config-24.8.0.tgz", + "integrity": "sha512-Czl3Nn2uEzVGsOeaewGWoDPD8GStxCpAe0zOYs2x2l0fZAgPbCr3uwUkgNKV3LwE13VXythM946cd5rdGkkBZw==", "dev": true, "requires": { "@babel/core": "^7.1.0", - "babel-jest": "^24.1.0", + "@jest/test-sequencer": "^24.8.0", + "@jest/types": "^24.8.0", + "babel-jest": "^24.8.0", "chalk": "^2.0.1", "glob": "^7.1.1", - "jest-environment-jsdom": "^24.0.0", - "jest-environment-node": "^24.0.0", - "jest-get-type": "^24.0.0", - "jest-jasmine2": "^24.1.0", - "jest-regex-util": "^24.0.0", - "jest-resolve": "^24.1.0", - "jest-util": "^24.0.0", - "jest-validate": "^24.0.0", + "jest-environment-jsdom": "^24.8.0", + "jest-environment-node": "^24.8.0", + "jest-get-type": "^24.8.0", + "jest-jasmine2": "^24.8.0", + "jest-regex-util": "^24.3.0", + "jest-resolve": "^24.8.0", + "jest-util": "^24.8.0", + "jest-validate": "^24.8.0", "micromatch": "^3.1.10", - "pretty-format": "^24.0.0", - "realpath-native": "^1.0.2" + "pretty-format": "^24.8.0", + "realpath-native": "^1.1.0" }, "dependencies": { "ansi-styles": { @@ -3773,15 +4177,15 @@ } }, "jest-diff": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.0.0.tgz", - "integrity": "sha512-XY5wMpRaTsuMoU+1/B2zQSKQ9RdE9gsLkGydx3nvApeyPijLA8GtEvIcPwISRCer+VDf9W1mStTYYq6fPt8ryA==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-diff/-/jest-diff-24.8.0.tgz", + "integrity": "sha512-wxetCEl49zUpJ/bvUmIFjd/o52J+yWcoc5ZyPq4/W1LUKGEhRYDIbP1KcF6t+PvqNrGAFk4/JhtxDq/Nnzs66g==", "dev": true, "requires": { "chalk": "^2.0.1", - "diff-sequences": "^24.0.0", - "jest-get-type": "^24.0.0", - "pretty-format": "^24.0.0" + "diff-sequences": "^24.3.0", + "jest-get-type": "^24.8.0", + "pretty-format": "^24.8.0" }, "dependencies": { "ansi-styles": { @@ -3816,24 +4220,25 @@ } }, "jest-docblock": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-24.0.0.tgz", - "integrity": "sha512-KfAKZ4SN7CFOZpWg4i7g7MSlY0M+mq7K0aMqENaG2vHuhC9fc3vkpU/iNN9sOus7v3h3Y48uEjqz3+Gdn2iptA==", + "version": "24.3.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-24.3.0.tgz", + "integrity": "sha512-nlANmF9Yq1dufhFlKG9rasfQlrY7wINJbo3q01tu56Jv5eBU5jirylhF2O5ZBnLxzOVBGRDz/9NAwNyBtG4Nyg==", "dev": true, "requires": { "detect-newline": "^2.1.0" } }, "jest-each": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-24.0.0.tgz", - "integrity": "sha512-gFcbY4Cu55yxExXMkjrnLXov3bWO3dbPAW7HXb31h/DNWdNc/6X8MtxGff8nh3/MjkF9DpVqnj0KsPKuPK0cpA==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-each/-/jest-each-24.8.0.tgz", + "integrity": "sha512-NrwK9gaL5+XgrgoCsd9svsoWdVkK4gnvyhcpzd6m487tXHqIdYeykgq3MKI1u4I+5Zf0tofr70at9dWJDeb+BA==", "dev": true, "requires": { + "@jest/types": "^24.8.0", "chalk": "^2.0.1", - "jest-get-type": "^24.0.0", - "jest-util": "^24.0.0", - "pretty-format": "^24.0.0" + "jest-get-type": "^24.8.0", + "jest-util": "^24.8.0", + "pretty-format": "^24.8.0" }, "dependencies": { "ansi-styles": { @@ -3868,46 +4273,56 @@ } }, "jest-environment-jsdom": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-24.0.0.tgz", - "integrity": "sha512-1YNp7xtxajTRaxbylDc2pWvFnfDTH5BJJGyVzyGAKNt/lEULohwEV9zFqTgG4bXRcq7xzdd+sGFws+LxThXXOw==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-environment-jsdom/-/jest-environment-jsdom-24.8.0.tgz", + "integrity": "sha512-qbvgLmR7PpwjoFjM/sbuqHJt/NCkviuq9vus9NBn/76hhSidO+Z6Bn9tU8friecegbJL8gzZQEMZBQlFWDCwAQ==", "dev": true, "requires": { - "jest-mock": "^24.0.0", - "jest-util": "^24.0.0", + "@jest/environment": "^24.8.0", + "@jest/fake-timers": "^24.8.0", + "@jest/types": "^24.8.0", + "jest-mock": "^24.8.0", + "jest-util": "^24.8.0", "jsdom": "^11.5.1" } }, "jest-environment-node": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-24.0.0.tgz", - "integrity": "sha512-62fOFcaEdU0VLaq8JL90TqwI7hLn0cOKOl8vY2n477vRkCJRojiRRtJVRzzCcgFvs6gqU97DNqX5R0BrBP6Rxg==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-environment-node/-/jest-environment-node-24.8.0.tgz", + "integrity": "sha512-vIGUEScd1cdDgR6sqn2M08sJTRLQp6Dk/eIkCeO4PFHxZMOgy+uYLPMC4ix3PEfM5Au/x3uQ/5Tl0DpXXZsJ/Q==", "dev": true, "requires": { - "jest-mock": "^24.0.0", - "jest-util": "^24.0.0" + "@jest/environment": "^24.8.0", + "@jest/fake-timers": "^24.8.0", + "@jest/types": "^24.8.0", + "jest-mock": "^24.8.0", + "jest-util": "^24.8.0" } }, "jest-get-type": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.0.0.tgz", - "integrity": "sha512-z6/Eyf6s9ZDGz7eOvl+fzpuJmN9i0KyTt1no37/dHu8galssxz5ZEgnc1KaV8R31q1khxyhB4ui/X5ZjjPk77w==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-get-type/-/jest-get-type-24.8.0.tgz", + "integrity": "sha512-RR4fo8jEmMD9zSz2nLbs2j0zvPpk/KCEz3a62jJWbd2ayNo0cb+KFRxPHVhE4ZmgGJEQp0fosmNz84IfqM8cMQ==", "dev": true }, "jest-haste-map": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-24.0.0.tgz", - "integrity": "sha512-CcViJyUo41IQqttLxXVdI41YErkzBKbE6cS6dRAploCeutePYfUimWd3C9rQEWhX0YBOQzvNsC0O9nYxK2nnxQ==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-haste-map/-/jest-haste-map-24.8.0.tgz", + "integrity": "sha512-ZBPRGHdPt1rHajWelXdqygIDpJx8u3xOoLyUBWRW28r3tagrgoepPrzAozW7kW9HrQfhvmiv1tncsxqHJO1onQ==", "dev": true, "requires": { + "@jest/types": "^24.8.0", + "anymatch": "^2.0.0", "fb-watchman": "^2.0.0", + "fsevents": "^1.2.7", "graceful-fs": "^4.1.15", "invariant": "^2.2.4", - "jest-serializer": "^24.0.0", - "jest-util": "^24.0.0", - "jest-worker": "^24.0.0", + "jest-serializer": "^24.4.0", + "jest-util": "^24.8.0", + "jest-worker": "^24.6.0", "micromatch": "^3.1.10", - "sane": "^3.0.0" + "sane": "^4.0.3", + "walker": "^1.0.7" }, "dependencies": { "graceful-fs": { @@ -3919,22 +4334,26 @@ } }, "jest-jasmine2": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-24.1.0.tgz", - "integrity": "sha512-H+o76SdSNyCh9fM5K8upK45YTo/DiFx5w2YAzblQebSQmukDcoVBVeXynyr7DDnxh+0NTHYRCLwJVf3tC518wg==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-jasmine2/-/jest-jasmine2-24.8.0.tgz", + "integrity": "sha512-cEky88npEE5LKd5jPpTdDCLvKkdyklnaRycBXL6GNmpxe41F0WN44+i7lpQKa/hcbXaQ+rc9RMaM4dsebrYong==", "dev": true, "requires": { "@babel/traverse": "^7.1.0", + "@jest/environment": "^24.8.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", "chalk": "^2.0.1", "co": "^4.6.0", - "expect": "^24.1.0", + "expect": "^24.8.0", "is-generator-fn": "^2.0.0", - "jest-each": "^24.0.0", - "jest-matcher-utils": "^24.0.0", - "jest-message-util": "^24.0.0", - "jest-snapshot": "^24.1.0", - "jest-util": "^24.0.0", - "pretty-format": "^24.0.0", + "jest-each": "^24.8.0", + "jest-matcher-utils": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-runtime": "^24.8.0", + "jest-snapshot": "^24.8.0", + "jest-util": "^24.8.0", + "pretty-format": "^24.8.0", "throat": "^4.0.0" }, "dependencies": { @@ -3970,24 +4389,24 @@ } }, "jest-leak-detector": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.0.0.tgz", - "integrity": "sha512-ZYHJYFeibxfsDSKowjDP332pStuiFT2xfc5R67Rjm/l+HFJWJgNIOCOlQGeXLCtyUn3A23+VVDdiCcnB6dTTrg==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-leak-detector/-/jest-leak-detector-24.8.0.tgz", + "integrity": "sha512-cG0yRSK8A831LN8lIHxI3AblB40uhv0z+SsQdW3GoMMVcK+sJwrIIyax5tu3eHHNJ8Fu6IMDpnLda2jhn2pD/g==", "dev": true, "requires": { - "pretty-format": "^24.0.0" + "pretty-format": "^24.8.0" } }, "jest-matcher-utils": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-24.0.0.tgz", - "integrity": "sha512-LQTDmO+aWRz1Tf9HJg+HlPHhDh1E1c65kVwRFo5mwCVp5aQDzlkz4+vCvXhOKFjitV2f0kMdHxnODrXVoi+rlA==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-matcher-utils/-/jest-matcher-utils-24.8.0.tgz", + "integrity": "sha512-lex1yASY51FvUuHgm0GOVj7DCYEouWSlIYmCW7APSqB9v8mXmKSn5+sWVF0MhuASG0bnYY106/49JU1FZNl5hw==", "dev": true, "requires": { "chalk": "^2.0.1", - "jest-diff": "^24.0.0", - "jest-get-type": "^24.0.0", - "pretty-format": "^24.0.0" + "jest-diff": "^24.8.0", + "jest-get-type": "^24.8.0", + "pretty-format": "^24.8.0" }, "dependencies": { "ansi-styles": { @@ -4022,12 +4441,15 @@ } }, "jest-message-util": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-24.0.0.tgz", - "integrity": "sha512-J9ROJIwz/IeC+eV1XSwnRK4oAwPuhmxEyYx1+K5UI+pIYwFZDSrfZaiWTdq0d2xYFw4Xiu+0KQWsdsQpgJMf3Q==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-message-util/-/jest-message-util-24.8.0.tgz", + "integrity": "sha512-p2k71rf/b6ns8btdB0uVdljWo9h0ovpnEe05ZKWceQGfXYr4KkzgKo3PBi8wdnd9OtNh46VpNIJynUn/3MKm1g==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", + "@types/stack-utils": "^1.0.1", "chalk": "^2.0.1", "micromatch": "^3.1.10", "slash": "^2.0.0", @@ -4071,27 +4493,38 @@ } } }, - "jest-mock": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-24.0.0.tgz", - "integrity": "sha512-sQp0Hu5fcf5NZEh1U9eIW2qD0BwJZjb63Yqd98PQJFvf/zzUTBoUAwv/Dc/HFeNHIw1f3hl/48vNn+j3STaI7A==", + "jest-mock": { + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-mock/-/jest-mock-24.8.0.tgz", + "integrity": "sha512-6kWugwjGjJw+ZkK4mDa0Df3sDlUTsV47MSrT0nGQ0RBWJbpODDQ8MHDVtGtUYBne3IwZUhtB7elxHspU79WH3A==", + "dev": true, + "requires": { + "@jest/types": "^24.8.0" + } + }, + "jest-pnp-resolver": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/jest-pnp-resolver/-/jest-pnp-resolver-1.2.1.tgz", + "integrity": "sha512-pgFw2tm54fzgYvc/OHrnysABEObZCUNFnhjoRjaVOCN8NYc032/gVjPaHD4Aq6ApkSieWtfKAFQtmDKAmhupnQ==", "dev": true }, "jest-regex-util": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-24.0.0.tgz", - "integrity": "sha512-Jv/uOTCuC+PY7WpJl2mpoI+WbY2ut73qwwO9ByJJNwOCwr1qWhEW2Lyi2S9ZewUdJqeVpEBisdEVZSI+Zxo58Q==", + "version": "24.3.0", + "resolved": "https://registry.npmjs.org/jest-regex-util/-/jest-regex-util-24.3.0.tgz", + "integrity": "sha512-tXQR1NEOyGlfylyEjg1ImtScwMq8Oh3iJbGTjN7p0J23EuVX1MA8rwU69K4sLbCmwzgCUbVkm0FkSF9TdzOhtg==", "dev": true }, "jest-resolve": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.1.0.tgz", - "integrity": "sha512-TPiAIVp3TG6zAxH28u/6eogbwrvZjBMWroSLBDkwkHKrqxB/RIdwkWDye4uqPlZIXWIaHtifY3L0/eO5Z0f2wg==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-resolve/-/jest-resolve-24.8.0.tgz", + "integrity": "sha512-+hjSzi1PoRvnuOICoYd5V/KpIQmkAsfjFO71458hQ2Whi/yf1GDeBOFj8Gxw4LrApHsVJvn5fmjcPdmoUHaVKw==", "dev": true, "requires": { + "@jest/types": "^24.8.0", "browser-resolve": "^1.11.3", "chalk": "^2.0.1", - "realpath-native": "^1.0.0" + "jest-pnp-resolver": "^1.2.1", + "realpath-native": "^1.1.0" }, "dependencies": { "ansi-styles": { @@ -4126,33 +4559,39 @@ } }, "jest-resolve-dependencies": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-24.1.0.tgz", - "integrity": "sha512-2VwPsjd3kRPu7qe2cpytAgowCObk5AKeizfXuuiwgm1a9sijJDZe8Kh1sFj6FKvSaNEfCPlBVkZEJa2482m/Uw==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-resolve-dependencies/-/jest-resolve-dependencies-24.8.0.tgz", + "integrity": "sha512-hyK1qfIf/krV+fSNyhyJeq3elVMhK9Eijlwy+j5jqmZ9QsxwKBiP6qukQxaHtK8k6zql/KYWwCTQ+fDGTIJauw==", "dev": true, "requires": { - "jest-regex-util": "^24.0.0", - "jest-snapshot": "^24.1.0" + "@jest/types": "^24.8.0", + "jest-regex-util": "^24.3.0", + "jest-snapshot": "^24.8.0" } }, "jest-runner": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-24.1.0.tgz", - "integrity": "sha512-CDGOkT3AIFl16BLL/OdbtYgYvbAprwJ+ExKuLZmGSCSldwsuU2dEGauqkpvd9nphVdAnJUcP12e/EIlnTX0QXg==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-runner/-/jest-runner-24.8.0.tgz", + "integrity": "sha512-utFqC5BaA3JmznbissSs95X1ZF+d+4WuOWwpM9+Ak356YtMhHE/GXUondZdcyAAOTBEsRGAgH/0TwLzfI9h7ow==", "dev": true, "requires": { + "@jest/console": "^24.7.1", + "@jest/environment": "^24.8.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", "chalk": "^2.4.2", "exit": "^0.1.2", "graceful-fs": "^4.1.15", - "jest-config": "^24.1.0", - "jest-docblock": "^24.0.0", - "jest-haste-map": "^24.0.0", - "jest-jasmine2": "^24.1.0", - "jest-leak-detector": "^24.0.0", - "jest-message-util": "^24.0.0", - "jest-runtime": "^24.1.0", - "jest-util": "^24.0.0", - "jest-worker": "^24.0.0", + "jest-config": "^24.8.0", + "jest-docblock": "^24.3.0", + "jest-haste-map": "^24.8.0", + "jest-jasmine2": "^24.8.0", + "jest-leak-detector": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-resolve": "^24.8.0", + "jest-runtime": "^24.8.0", + "jest-util": "^24.8.0", + "jest-worker": "^24.6.0", "source-map-support": "^0.5.6", "throat": "^4.0.0" }, @@ -4190,9 +4629,9 @@ "dev": true }, "source-map-support": { - "version": "0.5.10", - "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.10.tgz", - "integrity": "sha512-YfQ3tQFTK/yzlGJuX8pTwa4tifQj4QS2Mj7UegOu8jAz59MqIiMGPXxQhVQiIMNzayuUSF/jEuVnfFF5JqybmQ==", + "version": "0.5.12", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.12.tgz", + "integrity": "sha512-4h2Pbvyy15EE02G+JOZpUCmqWJuqrs+sEkzewTm++BPi7Hvn/HwcqLAcNxYAyI0x13CpPPn+kMjl+hplXMHITQ==", "dev": true, "requires": { "buffer-from": "^1.0.0", @@ -4211,32 +4650,33 @@ } }, "jest-runtime": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-24.1.0.tgz", - "integrity": "sha512-59/BY6OCuTXxGeDhEMU7+N33dpMQyXq7MLK07cNSIY/QYt2QZgJ7Tjx+rykBI0skAoigFl0A5tmT8UdwX92YuQ==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-runtime/-/jest-runtime-24.8.0.tgz", + "integrity": "sha512-Mq0aIXhvO/3bX44ccT+czU1/57IgOMyy80oM0XR/nyD5zgBcesF84BPabZi39pJVA6UXw+fY2Q1N+4BiVUBWOA==", "dev": true, "requires": { - "@babel/core": "^7.1.0", - "babel-plugin-istanbul": "^5.1.0", + "@jest/console": "^24.7.1", + "@jest/environment": "^24.8.0", + "@jest/source-map": "^24.3.0", + "@jest/transform": "^24.8.0", + "@jest/types": "^24.8.0", + "@types/yargs": "^12.0.2", "chalk": "^2.0.1", - "convert-source-map": "^1.4.0", "exit": "^0.1.2", - "fast-json-stable-stringify": "^2.0.0", "glob": "^7.1.3", "graceful-fs": "^4.1.15", - "jest-config": "^24.1.0", - "jest-haste-map": "^24.0.0", - "jest-message-util": "^24.0.0", - "jest-regex-util": "^24.0.0", - "jest-resolve": "^24.1.0", - "jest-snapshot": "^24.1.0", - "jest-util": "^24.0.0", - "jest-validate": "^24.0.0", - "micromatch": "^3.1.10", - "realpath-native": "^1.0.0", + "jest-config": "^24.8.0", + "jest-haste-map": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-mock": "^24.8.0", + "jest-regex-util": "^24.3.0", + "jest-resolve": "^24.8.0", + "jest-snapshot": "^24.8.0", + "jest-util": "^24.8.0", + "jest-validate": "^24.8.0", + "realpath-native": "^1.1.0", "slash": "^2.0.0", "strip-bom": "^3.0.0", - "write-file-atomic": "2.4.1", "yargs": "^12.0.2" }, "dependencies": { @@ -4261,9 +4701,9 @@ } }, "glob": { - "version": "7.1.3", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", - "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", "dev": true, "requires": { "fs.realpath": "^1.0.0", @@ -4298,26 +4738,28 @@ } }, "jest-serializer": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-24.0.0.tgz", - "integrity": "sha512-9FKxQyrFgHtx3ozU+1a8v938ILBE7S8Ko3uiAVjT8Yfi2o91j/fj81jacCQZ/Ihjiff/VsUCXVgQ+iF1XdImOw==", + "version": "24.4.0", + "resolved": "https://registry.npmjs.org/jest-serializer/-/jest-serializer-24.4.0.tgz", + "integrity": "sha512-k//0DtglVstc1fv+GY/VHDIjrtNjdYvYjMlbLUed4kxrE92sIUewOi5Hj3vrpB8CXfkJntRPDRjCrCvUhBdL8Q==", "dev": true }, "jest-snapshot": { - "version": "24.1.0", - "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-24.1.0.tgz", - "integrity": "sha512-th6TDfFqEmXvuViacU1ikD7xFb7lQsPn2rJl7OEmnfIVpnrx3QNY2t3PE88meeg0u/mQ0nkyvmC05PBqO4USFA==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-snapshot/-/jest-snapshot-24.8.0.tgz", + "integrity": "sha512-5ehtWoc8oU9/cAPe6fez6QofVJLBKyqkY2+TlKTOf0VllBB/mqUNdARdcjlZrs9F1Cv+/HKoCS/BknT0+tmfPg==", "dev": true, "requires": { "@babel/types": "^7.0.0", + "@jest/types": "^24.8.0", "chalk": "^2.0.1", - "jest-diff": "^24.0.0", - "jest-matcher-utils": "^24.0.0", - "jest-message-util": "^24.0.0", - "jest-resolve": "^24.1.0", + "expect": "^24.8.0", + "jest-diff": "^24.8.0", + "jest-matcher-utils": "^24.8.0", + "jest-message-util": "^24.8.0", + "jest-resolve": "^24.8.0", "mkdirp": "^0.5.1", "natural-compare": "^1.4.0", - "pretty-format": "^24.0.0", + "pretty-format": "^24.8.0", "semver": "^5.5.0" }, "dependencies": { @@ -4353,16 +4795,20 @@ } }, "jest-util": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-24.0.0.tgz", - "integrity": "sha512-QxsALc4wguYS7cfjdQSOr5HTkmjzkHgmZvIDkcmPfl1ib8PNV8QUWLwbKefCudWS0PRKioV+VbQ0oCUPC691fQ==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-util/-/jest-util-24.8.0.tgz", + "integrity": "sha512-DYZeE+XyAnbNt0BG1OQqKy/4GVLPtzwGx5tsnDrFcax36rVE3lTA5fbvgmbVPUZf9w77AJ8otqR4VBbfFJkUZA==", "dev": true, "requires": { + "@jest/console": "^24.7.1", + "@jest/fake-timers": "^24.8.0", + "@jest/source-map": "^24.3.0", + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", "callsites": "^3.0.0", "chalk": "^2.0.1", "graceful-fs": "^4.1.15", "is-ci": "^2.0.0", - "jest-message-util": "^24.0.0", "mkdirp": "^0.5.1", "slash": "^2.0.0", "source-map": "^0.6.0" @@ -4418,16 +4864,17 @@ } }, "jest-validate": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.0.0.tgz", - "integrity": "sha512-vMrKrTOP4BBFIeOWsjpsDgVXATxCspC9S1gqvbJ3Tnn/b9ACsJmteYeVx9830UMV28Cob1RX55x96Qq3Tfad4g==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-validate/-/jest-validate-24.8.0.tgz", + "integrity": "sha512-+/N7VOEMW1Vzsrk3UWBDYTExTPwf68tavEPKDnJzrC6UlHtUDU/fuEdXqFoHzv9XnQ+zW6X3qMZhJ3YexfeLDA==", "dev": true, "requires": { + "@jest/types": "^24.8.0", "camelcase": "^5.0.0", "chalk": "^2.0.1", - "jest-get-type": "^24.0.0", + "jest-get-type": "^24.8.0", "leven": "^2.1.0", - "pretty-format": "^24.0.0" + "pretty-format": "^24.8.0" }, "dependencies": { "ansi-styles": { @@ -4440,9 +4887,9 @@ } }, "camelcase": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true }, "chalk": { @@ -4468,14 +4915,17 @@ } }, "jest-watcher": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-24.0.0.tgz", - "integrity": "sha512-GxkW2QrZ4YxmW1GUWER05McjVDunBlKMFfExu+VsGmXJmpej1saTEKvONdx5RJBlVdpPI5x6E3+EDQSIGgl53g==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/jest-watcher/-/jest-watcher-24.8.0.tgz", + "integrity": "sha512-SBjwHt5NedQoVu54M5GEx7cl7IGEFFznvd/HNT8ier7cCAx/Qgu9ZMlaTQkvK22G1YOpcWBLQPFSImmxdn3DAw==", "dev": true, "requires": { + "@jest/test-result": "^24.8.0", + "@jest/types": "^24.8.0", + "@types/yargs": "^12.0.9", "ansi-escapes": "^3.0.0", "chalk": "^2.0.1", - "jest-util": "^24.0.0", + "jest-util": "^24.8.0", "string-length": "^2.0.0" }, "dependencies": { @@ -4511,9 +4961,9 @@ } }, "jest-worker": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.0.0.tgz", - "integrity": "sha512-s64/OThpfQvoCeHG963MiEZOAAxu8kHsaL/rCMF7lpdzo7vgF0CtPml9hfguOMgykgH/eOm4jFP4ibfHLruytg==", + "version": "24.6.0", + "resolved": "https://registry.npmjs.org/jest-worker/-/jest-worker-24.6.0.tgz", + "integrity": "sha512-jDwgW5W9qGNvpI1tNnvajh0a5IE/PuGLFmHk6aR/BZFz8tSgGw17GsDPXAJ6p91IvYDjOw8GpFbvvZGAK+DPQQ==", "dev": true, "requires": { "merge-stream": "^1.0.1", @@ -4538,9 +4988,9 @@ "dev": true }, "js-yaml": { - "version": "3.12.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.0.tgz", - "integrity": "sha512-PIt2cnwmPfL4hKNwqeiuz4bKfnzHTBv6HyVgjahA6mPLwPDzjDWrplJBMjHUFxku/N3FlmrbyPclad+I+4mJ3A==", + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", "dev": true, "requires": { "argparse": "^1.0.7", @@ -4548,64 +4998,65 @@ } }, "js2xmlparser": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-3.0.0.tgz", - "integrity": "sha1-P7YOqgicVED5MZ9RdgzNB+JJlzM=", + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js2xmlparser/-/js2xmlparser-4.0.0.tgz", + "integrity": "sha512-WuNgdZOXVmBk5kUPMcTcVUpbGRzLfNkv7+7APq7WiDihpXVKrgxo6wwRpRl9OQeEBgKCVk9mR7RbzrnNWC8oBw==", "dev": true, "requires": { - "xmlcreate": "^1.0.1" + "xmlcreate": "^2.0.0" } }, "jsbn": { "version": "0.1.1", "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", - "dev": true, - "optional": true + "dev": true }, "jsdoc": { - "version": "3.5.5", - "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.5.5.tgz", - "integrity": "sha512-6PxB65TAU4WO0Wzyr/4/YhlGovXl0EVYfpKbpSroSj0qBxT4/xod/l40Opkm38dRHRdQgdeY836M0uVnJQG7kg==", - "dev": true, - "requires": { - "babylon": "7.0.0-beta.19", - "bluebird": "~3.5.0", - "catharsis": "~0.8.9", - "escape-string-regexp": "~1.0.5", - "js2xmlparser": "~3.0.0", - "klaw": "~2.0.0", - "marked": "~0.3.6", - "mkdirp": "~0.5.1", - "requizzle": "~0.2.1", - "strip-json-comments": "~2.0.1", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/jsdoc/-/jsdoc-3.6.2.tgz", + "integrity": "sha512-S2vzg99C5+gb7FWlrK4TVdyzVPGGkdvpDkCEJH1JABi2PKzPeLu5/zZffcJUifgWUJqXWl41Hoc+MmuM2GukIg==", + "dev": true, + "requires": { + "@babel/parser": "^7.4.4", + "bluebird": "^3.5.4", + "catharsis": "^0.8.10", + "escape-string-regexp": "^2.0.0", + "js2xmlparser": "^4.0.0", + "klaw": "^3.0.0", + "markdown-it": "^8.4.2", + "markdown-it-anchor": "^5.0.2", + "marked": "^0.6.2", + "mkdirp": "^0.5.1", + "requizzle": "^0.2.2", + "strip-json-comments": "^3.0.1", "taffydb": "2.6.2", - "underscore": "~1.8.3" + "underscore": "~1.9.1" }, "dependencies": { - "babylon": { - "version": "7.0.0-beta.19", - "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.19.tgz", - "integrity": "sha512-Vg0C9s/REX6/WIXN37UKpv5ZhRi6A4pjHlpkE34+8/a6c2W1Q692n3hmc+SZG5lKRnaExLUbxtJ1SVT+KaCQ/A==", + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", "dev": true } } }, "jsdoc-api": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/jsdoc-api/-/jsdoc-api-4.0.3.tgz", - "integrity": "sha512-dfYq9JgB+XahY0XfSEw93PmXmocjwYcvJ5aMuQUJ/OdDRGWamf2SSOk3W06Bsj8qdjp/UdefzqpP/mpwsvHuvA==", + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/jsdoc-api/-/jsdoc-api-5.0.1.tgz", + "integrity": "sha512-bntcT/3No4dPJZs9KX0AN3vrX/7P6PwDXVKANCXYpa0WJsbud41yAunoMxGFS4APHwmDoWl8E0ZuowLCOiOOFw==", "dev": true, "requires": { - "array-back": "^2.0.0", + "array-back": "^3.1.0", "cache-point": "^0.4.1", "collect-all": "^1.0.3", - "file-set": "^2.0.0", + "file-set": "^2.0.1", "fs-then-native": "^2.0.0", - "jsdoc": "~3.5.5", + "jsdoc": "^3.6.1", "object-to-spawn-args": "^1.1.1", "temp-path": "^1.0.0", - "walk-back": "^3.0.0" + "walk-back": "^3.0.1" } }, "jsdoc-parse": { @@ -4620,21 +5071,32 @@ "reduce-extract": "^1.0.0", "sort-array": "^2.0.0", "test-value": "^3.0.0" + }, + "dependencies": { + "array-back": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", + "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", + "dev": true, + "requires": { + "typical": "^2.6.1" + } + } } }, "jsdoc-to-markdown": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/jsdoc-to-markdown/-/jsdoc-to-markdown-4.0.1.tgz", - "integrity": "sha512-LHJRoLoLyDdxNcColgkLoB/rFG5iRP+PNJjMILI0x+95IdEAtyjSt0wJ6ZlKxRpkhBYtQXTQQ119hMqPIUZzTQ==", + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/jsdoc-to-markdown/-/jsdoc-to-markdown-5.0.0.tgz", + "integrity": "sha512-3gKEnbay7dSdyvtMDDkUf4r7pmBVgs3aqeT0Cg/ngTILPpJUzf8iKgASIo5psF007L45OIJtIuRX5VL/YUXKaA==", "dev": true, "requires": { - "array-back": "^2.0.0", + "array-back": "^3.1.0", "command-line-tool": "^0.8.0", "config-master": "^3.1.0", - "dmd": "^3.0.10", - "jsdoc-api": "^4.0.1", + "dmd": "^4.0.0", + "jsdoc-api": "^5.0.1", "jsdoc-parse": "^3.0.1", - "walk-back": "^3.0.0" + "walk-back": "^3.0.1" } }, "jsdom": { @@ -4690,9 +5152,9 @@ "dev": true }, "json-schema-traverse": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.3.1.tgz", - "integrity": "sha1-NJptRMU6Ud6JtAgFxdXlm0F9M0A=", + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", "dev": true }, "json-stringify-safe": { @@ -4738,27 +5200,20 @@ } }, "klaw": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/klaw/-/klaw-2.0.0.tgz", - "integrity": "sha1-WcEo4Nxc5BAgEVEZTuucv4WGUPY=", + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/klaw/-/klaw-3.0.0.tgz", + "integrity": "sha512-0Fo5oir+O9jnXu5EefYbVK+mHMBeEVEy2cmctR1O1NECcCkPRreJKrS6Qt/j3KC2C148Dfo9i3pCmCMsdqGr0g==", "dev": true, "requires": { "graceful-fs": "^4.1.9" } }, "kleur": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.2.tgz", - "integrity": "sha512-3h7B2WRT5LNXOtQiAaWonilegHcPSf9nLVXlSTci8lu1dZUuui61+EsPEZqSVxY7rXYmB2DVKMQILxaO5WL61Q==", + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/kleur/-/kleur-3.0.3.tgz", + "integrity": "sha512-eTIzlVOSUR+JxdDFepEYcBMtZ9Qqdef+rnzWdRZuMbOywu5tO2w2N7rqjoANZ5k9vywhL6Br1VRjUIgTQx4E8w==", "dev": true }, - "lazy-cache": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/lazy-cache/-/lazy-cache-1.0.4.tgz", - "integrity": "sha1-odePw6UEdMuAhF07O24dpJpEbo4=", - "dev": true, - "optional": true - }, "lcid": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/lcid/-/lcid-2.0.0.tgz", @@ -4790,6 +5245,15 @@ "type-check": "~0.3.2" } }, + "linkify-it": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/linkify-it/-/linkify-it-2.1.0.tgz", + "integrity": "sha512-4REs8/062kV2DSHxNfq5183zrqXMl7WP0WzABH9IeJI+NLm429FgE1PDecltYfnOoFDFlZGh2T8PfZn0r+GTRg==", + "dev": true, + "requires": { + "uc.micro": "^1.0.1" + } + }, "load-json-file": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", @@ -4813,9 +5277,9 @@ } }, "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==", + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true }, "lodash.camelcase": { @@ -4848,13 +5312,6 @@ "integrity": "sha1-7dFMgk4sycHgsKG0K7UhBRakJDg=", "dev": true }, - "longest": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/longest/-/longest-1.0.1.tgz", - "integrity": "sha1-MKCy2jj3N3DoKUoNIuZiXtd9AJc=", - "dev": true, - "optional": true - }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", @@ -4875,12 +5332,27 @@ } }, "make-dir": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", - "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-2.1.0.tgz", + "integrity": "sha512-LS9X+dc8KLxXCb8dni79fLIIUA5VyZoyjSMCwTluaXA0o27cCK0bhXkpgw+sTXVpPy/lSO57ilRixqk0vDmtRA==", "dev": true, "requires": { - "pify": "^3.0.0" + "pify": "^4.0.1", + "semver": "^5.6.0" + }, + "dependencies": { + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "semver": { + "version": "5.7.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.7.0.tgz", + "integrity": "sha512-Ya52jSX2u7QKghxeoFGpLwCtGlt7j0oY9DYb5apt9nPlJ42ID+ulTXESnt/qAQcoSERyZ5sl3LDIOw0nAn/5DA==", + "dev": true + } } }, "make-error": { @@ -4922,29 +5394,48 @@ "object-visit": "^1.0.0" } }, + "markdown-it": { + "version": "8.4.2", + "resolved": "https://registry.npmjs.org/markdown-it/-/markdown-it-8.4.2.tgz", + "integrity": "sha512-GcRz3AWTqSUphY3vsUqQSFMbgR38a4Lh3GWlHRh/7MRwz8mcu9n2IO7HOh+bXHrR9kOPDl5RNCaEsrneb+xhHQ==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "entities": "~1.1.1", + "linkify-it": "^2.0.0", + "mdurl": "^1.0.1", + "uc.micro": "^1.0.5" + } + }, + "markdown-it-anchor": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/markdown-it-anchor/-/markdown-it-anchor-5.1.0.tgz", + "integrity": "sha512-wJOmyXzDUxI8iuowEsaQAKMQBButhSw8j64SpgcaL75QZYC/OSZV66Fnr50lfMLYNGtV0rJdw2fmLwXCT6T+bw==", + "dev": true + }, "marked": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", - "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", + "version": "0.6.2", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.6.2.tgz", + "integrity": "sha512-LqxwVH3P/rqKX4EKGz7+c2G9r98WeM/SW34ybhgNGhUQNKtf1GmmSkJ6cDGJ/t6tiyae49qRkpyTw2B9HOrgUA==", + "dev": true + }, + "mdurl": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mdurl/-/mdurl-1.0.1.tgz", + "integrity": "sha1-/oWy7HWlkDfyrf7BAP1sYBdhFS4=", "dev": true }, "mem": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/mem/-/mem-4.1.0.tgz", - "integrity": "sha512-I5u6Q1x7wxO0kdOpYBB28xueHADYps5uty/zg936CiG8NTe5sJL8EjrCuLneuDW3PlMdZBGDIn8BirEVdovZvg==", + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/mem/-/mem-4.3.0.tgz", + "integrity": "sha512-qX2bG48pTqYRVmDB37rn/6PT7LcR8T7oAX3bf99u1Tt1nzxYfxkgqDwUwolPlXweM0XzBOBFzSx4kfp7KP1s/w==", "dev": true, "requires": { "map-age-cleaner": "^0.1.1", - "mimic-fn": "^1.0.0", + "mimic-fn": "^2.0.0", "p-is-promise": "^2.0.0" } }, - "merge": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/merge/-/merge-1.2.1.tgz", - "integrity": "sha512-VjFo4P5Whtj4vsLzsYBu5ayHhoHJ0UqNm7ibvShmbmoz7tGi0vXaoJbGdB+GmDMLUdg8DpQXEIeVDAe8MaABvQ==", - "dev": true - }, "merge-stream": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/merge-stream/-/merge-stream-1.0.1.tgz", @@ -4984,24 +5475,24 @@ } }, "mime-db": { - "version": "1.36.0", - "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.36.0.tgz", - "integrity": "sha512-L+xvyD9MkoYMXb1jAmzI/lWYAxAMCPvIBSWur0PZ5nOf5euahRLVqH//FKW9mWp2lkqUgYiXPgkzfMUFi4zVDw==", + "version": "1.40.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.40.0.tgz", + "integrity": "sha512-jYdeOMPy9vnxEqFRRo6ZvTZ8d9oPb+k18PKoYNYUe2stVEBPPwsln/qWzdbmaIvnhZ9v2P+CuecK+fpUfsV2mA==", "dev": true }, "mime-types": { - "version": "2.1.20", - "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.20.tgz", - "integrity": "sha512-HrkrPaP9vGuWbLK1B1FfgAkbqNjIuy4eHlIYnFi7kamZyLLrGlo2mpcx0bBmNpKqBtYtAfGbodDddIgddSJC2A==", + "version": "2.1.24", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.24.tgz", + "integrity": "sha512-WaFHS3MCl5fapm3oLxU4eYDw77IQM2ACcxQ9RIxfaC3ooc6PFuBMGZZsYpvoXS5D5QTWPieo1jjLdAm3TBP3cQ==", "dev": true, "requires": { - "mime-db": "~1.36.0" + "mime-db": "1.40.0" } }, "mimic-fn": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", - "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", "dev": true }, "minimatch": { @@ -5062,9 +5553,9 @@ "dev": true }, "nan": { - "version": "2.12.1", - "resolved": "https://registry.npmjs.org/nan/-/nan-2.12.1.tgz", - "integrity": "sha512-JY7V6lRkStKcKTvHO5NVSQRv+RV+FIL5pvDoLiAtSL9pKlC5x9PKQcZDsq7m4FO4d57mkhC6Z+QhAh3Jdk5JFw==", + "version": "2.14.0", + "resolved": "https://registry.npmjs.org/nan/-/nan-2.14.0.tgz", + "integrity": "sha512-INOFj37C7k3AfaNTtX8RhsTw7qRy7eLET14cROi9+5HAVbbHuIWUHEauBv5qT4Av2tWasiTY1Jw6puUNqRJXQg==", "dev": true, "optional": true }, @@ -5101,12 +5592,24 @@ "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", "dev": true }, + "neo-async": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/neo-async/-/neo-async-2.6.1.tgz", + "integrity": "sha512-iyam8fBuCUpWeKPGpaNMetEocMt364qkCsfL9JuhjXX6dRnguRVOfk2GZaDpPjcOKiiXCPINZC1GczQ7iTq3Zw==", + "dev": true + }, "nice-try": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, + "node-fetch": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.0.tgz", + "integrity": "sha512-8dG4H5ujfvFiqDmVu9fQ5bOHUC15JMjMY/Zumv26oOvvVJjM67KF8koCWIabKQ1GJIa9r2mMZscBq/TbdOcmNA==", + "dev": true + }, "node-int64": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz", @@ -5142,17 +5645,6 @@ "resolve": "^1.10.0", "semver": "2 || 3 || 4 || 5", "validate-npm-package-license": "^3.0.1" - }, - "dependencies": { - "resolve": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", - "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - } } }, "normalize-path": { @@ -5180,9 +5672,9 @@ "dev": true }, "nwsapi": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.0.tgz", - "integrity": "sha512-ZG3bLAvdHmhIjaQ/Db1qvBxsGvFMLIRpQszyqbg31VJ53UP++uZX1/gf3Ut96pdwN9AuDwlMqIYLm0UPCdUeHg==", + "version": "2.1.4", + "resolved": "https://registry.npmjs.org/nwsapi/-/nwsapi-2.1.4.tgz", + "integrity": "sha512-iGfd9Y6SFdTNldEy2L0GUhcarIutFmk+MPWIn9dmj8NMIup03G08uUF2KGbbmv/Ux4RT0VZJoP/sVbWA6d/VIw==", "dev": true }, "oauth-sign": { @@ -5220,9 +5712,9 @@ "dev": true }, "object-keys": { - "version": "1.0.12", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.0.12.tgz", - "integrity": "sha512-FTMyFUm2wBcGHnH2eXmz7tC6IwlqQZ6mVZ+6dm6vZ4IQIHjs6FdNsQBuKGPuUUUY6NfJw2PshC08Tn6LzLDOag==", + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", "dev": true }, "object-to-spawn-args": { @@ -5351,15 +5843,15 @@ "dev": true }, "p-is-promise": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.0.0.tgz", - "integrity": "sha512-pzQPhYMCAgLAKPWD2jC3Se9fEfrD9npNos0y150EeqZll7akhEgGhTW/slB6lHku8AvYGiJ+YJ5hfHKePPgFWg==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-is-promise/-/p-is-promise-2.1.0.tgz", + "integrity": "sha512-Y3W0wlRPK8ZMRbNq97l4M5otioeA5lm1z7bkNkxCka8HSPjR0xRWmpCmc9utiaLP9Jb1eD8BgeIxTW4AIF45Pg==", "dev": true }, "p-limit": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.1.0.tgz", - "integrity": "sha512-NhURkNcrVB+8hNfLuysU8enY5xn2KXphsHBaC2YmRNTZRc7RWusw6apSpdEj3jo4CMb6W9nrF6tTnsJsJeyu6g==", + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.0.tgz", + "integrity": "sha512-pZbTJpoUsCzV48Mc9Nh51VbwO0X9cuPFE8gYwx9BTCt9SF8/b7Zljd2fVgOxhIF/HDTKgpVzs+GPhyKfjLLFRQ==", "dev": true, "requires": { "p-try": "^2.0.0" @@ -5381,9 +5873,9 @@ "dev": true }, "p-try": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.0.0.tgz", - "integrity": "sha512-hMp0onDKIajHfIkdRk3P4CdCmErkYAxxDtP3Wx/4nZ3aGlau2VKh3mZpcuFkH27WQkL/3WBCPOktzA9ZOAnMQQ==", + "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 }, "parse-json": { @@ -5454,9 +5946,9 @@ "dev": true }, "pirates": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.0.tgz", - "integrity": "sha512-8t5BsXy1LUIjn3WWOlOuFDuKswhQb/tkak641lvBgmPOBUQHXveORtlMCp6OdPV1dtuTaEahKA8VNz6uLfKBtA==", + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pirates/-/pirates-4.0.1.tgz", + "integrity": "sha512-WuNqLTbMI3tmfef2TKxlQmAiLHKtFhlsCZnPIpuv2Ow0RDVO8lfy1Opf4NUzlMXLjPl+Men7AuVdX6TA+s+uGA==", "dev": true, "requires": { "node-modules-regexp": "^1.0.0" @@ -5512,19 +6004,21 @@ "dev": true }, "pretty-format": { - "version": "24.0.0", - "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.0.0.tgz", - "integrity": "sha512-LszZaKG665djUcqg5ZQq+XzezHLKrxsA86ZABTozp+oNhkdqa+tG2dX4qa6ERl5c/sRDrAa3lHmwnvKoP+OG/g==", + "version": "24.8.0", + "resolved": "https://registry.npmjs.org/pretty-format/-/pretty-format-24.8.0.tgz", + "integrity": "sha512-P952T7dkrDEplsR+TuY7q3VXDae5Sr7zmQb12JU/NDQa/3CH7/QW0yvqLcGN6jL+zQFKaoJcPc+yJxMTGmosqw==", "dev": true, "requires": { + "@jest/types": "^24.8.0", "ansi-regex": "^4.0.0", - "ansi-styles": "^3.2.0" + "ansi-styles": "^3.2.0", + "react-is": "^16.8.4" }, "dependencies": { "ansi-regex": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", - "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", "dev": true }, "ansi-styles": { @@ -5551,9 +6045,9 @@ "dev": true }, "prompts": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.0.2.tgz", - "integrity": "sha512-Pc/c53d2WZHJWZr78/BhZ5eHsdQtltbyBjHoA4T0cs/4yKJqCcoOHrq2SNKwtspVE0C+ebqAR5u0/mXwrHaADQ==", + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/prompts/-/prompts-2.1.0.tgz", + "integrity": "sha512-+x5TozgqYdOwWsQFZizE/Tra3fKvAoy037kOyU6cgz84n8f6zxngLOV4O32kTwt9FcLCxAqw0P/c8rOr9y+Gfg==", "dev": true, "requires": { "kleur": "^3.0.2", @@ -5567,9 +6061,9 @@ "dev": true }, "psl": { - "version": "1.1.29", - "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.29.tgz", - "integrity": "sha512-AeUmQ0oLN02flVHXWh9sSJF7mcdFq0ppid/JkErufc3hGIV/AMa8Fo9VgDo/cT2jFdOWoFvHp90qqBH54W+gjQ==", + "version": "1.1.31", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.1.31.tgz", + "integrity": "sha512-/6pt4+C+T+wZUieKR620OpzN/LlnNKuWjy1iFLQ/UG35JqHlR/89MP1d96dUfkf6Dne3TuLQzOYEYshJ+Hx8mw==", "dev": true }, "pump": { @@ -5583,9 +6077,9 @@ } }, "punycode": { - "version": "1.4.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", - "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, "qs": { @@ -5594,6 +6088,12 @@ "integrity": "sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==", "dev": true }, + "react-is": { + "version": "16.8.6", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.6.tgz", + "integrity": "sha512-aUk3bHfZ2bRSVFFbbeVS4i+lNPZr3/WM5jT2J5omUVV1zzcs1nAaf3l51ctA5FFvCRbhrH0bdAsRRQddFJZPtA==", + "dev": true + }, "read-pkg": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", @@ -5631,9 +6131,9 @@ } }, "realpath-native": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.0.2.tgz", - "integrity": "sha512-+S3zTvVt9yTntFrBpm7TQmQ3tzpCrnA1a/y+3cUHAc9ZR6aIjG0WNLR+Rj79QpJktY+VeW/TQtFlQ1bzsehI8g==", + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/realpath-native/-/realpath-native-1.1.0.tgz", + "integrity": "sha512-wlgPA6cCIIg9gKz0fgAPjnzh4yR/LnXovwuo9hvyGvx3h8nX4+/iLZplfUWasXpqD8BdnGnP5njOFjkUwPzvjA==", "dev": true, "requires": { "util.promisify": "^1.0.0" @@ -5676,9 +6176,9 @@ "dev": true }, "reduce-unique": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/reduce-unique/-/reduce-unique-1.0.0.tgz", - "integrity": "sha1-flhrz4ek4ytter2Cd/rWzeyfSAM=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/reduce-unique/-/reduce-unique-2.0.1.tgz", + "integrity": "sha512-x4jH/8L1eyZGR785WY+ePtyMNhycl1N2XOLxhCbzZFaqF4AXjLzqSxa2UHgJ2ZVR/HHyPOvl1L7xRnW8ye5MdA==", "dev": true }, "reduce-without": { @@ -5831,26 +6331,52 @@ "tough-cookie": "~2.4.3", "tunnel-agent": "^0.6.0", "uuid": "^3.3.2" + }, + "dependencies": { + "punycode": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-1.4.1.tgz", + "integrity": "sha1-wNWmOycYgArY4esPpSachN1BhF4=", + "dev": true + }, + "tough-cookie": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", + "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "dev": true, + "requires": { + "psl": "^1.1.24", + "punycode": "^1.4.1" + } + } } }, "request-promise-core": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.1.tgz", - "integrity": "sha1-Pu4AssWqgyOc+wTFcA2jb4HNCLY=", + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/request-promise-core/-/request-promise-core-1.1.2.tgz", + "integrity": "sha512-UHYyq1MO8GsefGEt7EprS8UrXsm1TxEvFUX1IMTuSLU2Rh7fTIdFtl8xD7JiEYiWU2dl+NYAjCTksTehQUxPag==", "dev": true, "requires": { - "lodash": "^4.13.1" + "lodash": "^4.17.11" + }, + "dependencies": { + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } } }, "request-promise-native": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.5.tgz", - "integrity": "sha1-UoF3D2jgyXGeUWP9P6tIIhX0/aU=", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/request-promise-native/-/request-promise-native-1.0.7.tgz", + "integrity": "sha512-rIMnbBdgNViL37nZ1b3L/VfPOpSi0TqVDQPAvO6U14lMzOLrt5nilxCQqtDKhZeDiW0/hkCXGoQjhgJd/tCh6w==", "dev": true, "requires": { - "request-promise-core": "1.1.1", - "stealthy-require": "^1.1.0", - "tough-cookie": ">=2.3.3" + "request-promise-core": "1.1.2", + "stealthy-require": "^1.1.1", + "tough-cookie": "^2.3.3" } }, "require-directory": { @@ -5860,33 +6386,36 @@ "dev": true }, "require-main-filename": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", - "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-2.0.0.tgz", + "integrity": "sha512-NKN5kMDylKuldxYLSUfrbo5Tuzh4hd+2E8NPPX02mZtn1VuREQToYe/ZdlJy+J3uCpfaiGF05e7B8W0iXbQHmg==", "dev": true }, "requizzle": { - "version": "0.2.1", - "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.1.tgz", - "integrity": "sha1-aUPDUwxNmn5G8c3dUcFY/GcM294=", + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/requizzle/-/requizzle-0.2.2.tgz", + "integrity": "sha512-oJ6y7JcUJkblRGhMByGNcszeLgU0qDxNKFCiUZR1XyzHyVsev+Mxb1tyygxLd1ORsKee1SA5BInFdUwY64GE/A==", "dev": true, "requires": { - "underscore": "~1.6.0" + "lodash": "^4.17.11" }, "dependencies": { - "underscore": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", - "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", "dev": true } } }, "resolve": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.1.7.tgz", - "integrity": "sha1-IDEU2CrSxe2ejgQRs5ModeiJ6Xs=", - "dev": true + "version": "1.11.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.11.0.tgz", + "integrity": "sha512-WL2pBDjqT6pGUNSUzMw00o4T7If+z4H2x3Gz893WoUQ5KW8Vr9txp00ykiP16VBaZF5+j/OcXJHZ9+PCvdiDKw==", + "dev": true, + "requires": { + "path-parse": "^1.0.6" + } }, "resolve-cwd": { "version": "2.0.0", @@ -5915,16 +6444,6 @@ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true }, - "right-align": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/right-align/-/right-align-0.1.3.tgz", - "integrity": "sha1-YTObci/mo1FWiSENJOFMlhSGE+8=", - "dev": true, - "optional": true, - "requires": { - "align-text": "^0.1.1" - } - }, "rimraf": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", @@ -5951,9 +6470,9 @@ } }, "rsvp": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-3.6.2.tgz", - "integrity": "sha512-OfWGQTb9vnwRjwtA2QwpG2ICclHC3pgXZO5xt8H2EfgDquO0qVdSb5T88L4qJVAEugbS56pAuV4XZM58UX8ulw==", + "version": "4.8.4", + "resolved": "https://registry.npmjs.org/rsvp/-/rsvp-4.8.4.tgz", + "integrity": "sha512-6FomvYPfs+Jy9TfXmBpBuMWNH94SgCsZmJKcanySzgNNP6LjWxBvyLTa9KaMfDDM5oxRfrKDB0r/qeRsLwnBfA==", "dev": true }, "safe-buffer": { @@ -5978,21 +6497,20 @@ "dev": true }, "sane": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/sane/-/sane-3.1.0.tgz", - "integrity": "sha512-G5GClRRxT1cELXfdAq7UKtUsv8q/ZC5k8lQGmjEm4HcAl3HzBy68iglyNCmw4+0tiXPCBZntslHlRhbnsSws+Q==", + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/sane/-/sane-4.1.0.tgz", + "integrity": "sha512-hhbzAgTIX8O7SHfp2c8/kREfEn4qO/9q8C9beyY6+tvZ87EpoZ3i1RIEvp27YBswnNbY9mWd6paKVmKbAgLfZA==", "dev": true, "requires": { + "@cnakazawa/watch": "^1.0.3", "anymatch": "^2.0.0", - "capture-exit": "^1.2.0", - "exec-sh": "^0.2.0", + "capture-exit": "^2.0.0", + "exec-sh": "^0.3.2", "execa": "^1.0.0", "fb-watchman": "^2.0.0", - "fsevents": "^1.2.3", "micromatch": "^3.1.4", "minimist": "^1.1.1", - "walker": "~1.0.5", - "watch": "~0.18.0" + "walker": "~1.0.5" }, "dependencies": { "minimist": { @@ -6278,9 +6796,9 @@ } }, "spdx-license-ids": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz", - "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==", + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.4.tgz", + "integrity": "sha512-7j8LYJLeY/Yb6ACbQ7F76qy5jHkp0U6jgBfJsk97bwWlVUnUWsAgpyaCvo17h0/RQGnQ036tVDomiwoI4pDkQA==", "dev": true }, "split-string": { @@ -6299,9 +6817,9 @@ "dev": true }, "sshpk": { - "version": "1.14.2", - "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.14.2.tgz", - "integrity": "sha1-xvxhZIo9nE52T9P8306hBeSSupg=", + "version": "1.16.1", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.16.1.tgz", + "integrity": "sha512-HXXqVUq7+pcKeLqqZj6mHFUMvXtOJt1uoUx09pFW6011inTMxqI8BA8PM95myrIyyKwdnzjdFjLiE6KBPVtJIg==", "dev": true, "requires": { "asn1": "~0.2.3", @@ -6459,9 +6977,9 @@ "dev": true }, "strip-json-comments": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", - "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.0.1.tgz", + "integrity": "sha512-VTyMAUfdm047mwKl+u79WIdrZxtFtn+nBxHeb844XBQ9uMNTuTHdx2hc5RiAJYqwTj3wc/xe5HLSdJSkJ+WfZw==", "dev": true }, "supports-color": { @@ -6487,6 +7005,17 @@ "lodash.padend": "^4.6.1", "typical": "^2.6.1", "wordwrapjs": "^3.0.0" + }, + "dependencies": { + "array-back": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", + "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", + "dev": true, + "requires": { + "typical": "^2.6.1" + } + } } }, "taffydb": { @@ -6495,6 +7024,17 @@ "integrity": "sha1-fLy2S1oUG2ou/CxdLGe04VCyomg=", "dev": true }, + "teeny-request": { + "version": "3.11.3", + "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-3.11.3.tgz", + "integrity": "sha512-CKncqSF7sH6p4rzCgkb/z/Pcos5efl0DmolzvlqRQUNcpRIruOhY9+T1FsIlyEbfWd7MsFpodROOwHYh2BaXzw==", + "dev": true, + "requires": { + "https-proxy-agent": "^2.2.1", + "node-fetch": "^2.2.0", + "uuid": "^3.3.2" + } + }, "temp-path": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/temp-path/-/temp-path-1.0.0.tgz", @@ -6502,15 +7042,31 @@ "dev": true }, "test-exclude": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.1.0.tgz", - "integrity": "sha512-gwf0S2fFsANC55fSeSqpb8BYk6w3FDvwZxfNjeF6FRgvFa43r+7wRiA/Q0IxoRU37wB/LE8IQ4221BsNucTaCA==", + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/test-exclude/-/test-exclude-5.2.3.tgz", + "integrity": "sha512-M+oxtseCFO3EDtAaGH7iiej3CBkzXqFMbzqYAACdzKui4eZA+pq3tZEwChvOdNfa7xxy8BfbmgJSIr43cC/+2g==", "dev": true, "requires": { - "arrify": "^1.0.1", + "glob": "^7.1.3", "minimatch": "^3.0.4", "read-pkg-up": "^4.0.0", - "require-main-filename": "^1.0.1" + "require-main-filename": "^2.0.0" + }, + "dependencies": { + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + } } }, "test-value": { @@ -6521,6 +7077,17 @@ "requires": { "array-back": "^2.0.0", "typical": "^2.6.1" + }, + "dependencies": { + "array-back": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/array-back/-/array-back-2.0.0.tgz", + "integrity": "sha512-eJv4pLLufP3g5kcZry0j6WXpIbzYw9GUB4mVJZno9wfwiBxbizTnHCw3VJb07cBihbFX48Y7oSrW9y+gt4glyw==", + "dev": true, + "requires": { + "typical": "^2.6.1" + } + } } }, "throat": { @@ -6573,13 +7140,13 @@ } }, "tough-cookie": { - "version": "2.4.3", - "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.4.3.tgz", - "integrity": "sha512-Q5srk/4vDM54WJsJio3XNn6K2sCG+CQ8G5Wz6bZhRZoAe/+TxjWB/GlFAnYEbkYVlON9FMk/fE3h2RLpPXo4lQ==", + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", "dev": true, "requires": { - "psl": "^1.1.24", - "punycode": "^1.4.1" + "psl": "^1.1.28", + "punycode": "^2.1.1" } }, "tr46": { @@ -6589,14 +7156,6 @@ "dev": true, "requires": { "punycode": "^2.1.0" - }, - "dependencies": { - "punycode": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", - "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", - "dev": true - } } }, "trim-right": { @@ -6606,9 +7165,9 @@ "dev": true }, "ts-jest": { - "version": "23.10.5", - "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-23.10.5.tgz", - "integrity": "sha512-MRCs9qnGoyKgFc8adDEntAOP64fWK1vZKnOYU1o2HxaqjdJvGqmkLCPCnVq1/If4zkUmEjKPnCiUisTrlX2p2A==", + "version": "24.0.2", + "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-24.0.2.tgz", + "integrity": "sha512-h6ZCZiA1EQgjczxq+uGLXQlNgeg02WWJBbeT8j6nyIBRQdglqbvzDoHahTEIiS6Eor6x8mK6PfZ7brQ9Q6tzHw==", "dev": true, "requires": { "bs-logger": "0.x", @@ -6661,23 +7220,24 @@ "dev": true }, "tslint": { - "version": "5.12.1", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.12.1.tgz", - "integrity": "sha512-sfodBHOucFg6egff8d1BvuofoOQ/nOeYNfbp7LDlKBcLNrL3lmS5zoiDGyOMdT7YsEXAwWpTdAHwOGOc8eRZAw==", + "version": "5.16.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.16.0.tgz", + "integrity": "sha512-UxG2yNxJ5pgGwmMzPMYh/CCnCnh0HfPgtlVRDs1ykZklufFBL1ZoTlWFRz2NQjcoEiDoRp+JyT0lhBbbH/obyA==", "dev": true, "requires": { - "babel-code-frame": "^6.22.0", + "@babel/code-frame": "^7.0.0", "builtin-modules": "^1.1.1", "chalk": "^2.3.0", "commander": "^2.12.1", "diff": "^3.2.0", "glob": "^7.1.1", - "js-yaml": "^3.7.0", + "js-yaml": "^3.13.0", "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", "resolve": "^1.3.2", "semver": "^5.3.0", "tslib": "^1.8.0", - "tsutils": "^2.27.2" + "tsutils": "^2.29.0" }, "dependencies": { "ansi-styles": { @@ -6700,15 +7260,6 @@ "supports-color": "^5.3.0" } }, - "resolve": { - "version": "1.10.0", - "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", - "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", - "dev": true, - "requires": { - "path-parse": "^1.0.6" - } - }, "supports-color": { "version": "5.5.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", @@ -6742,8 +7293,7 @@ "version": "0.14.5", "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", "integrity": "sha1-WuaBd/GS1EViadEIr6k/+HQ/T2Q=", - "dev": true, - "optional": true + "dev": true }, "type-check": { "version": "0.3.2", @@ -6761,9 +7311,9 @@ "dev": true }, "typescript": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.3.3.tgz", - "integrity": "sha512-Y21Xqe54TBVp+VDSNbuDYdGw0BpoR/Q6wo/+35M8PAU0vipahnyduJWirxxdxjsAkS7hue53x2zp8gz7F05u0A==", + "version": "3.4.5", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.5.tgz", + "integrity": "sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==", "dev": true }, "typical": { @@ -6772,6 +7322,12 @@ "integrity": "sha1-XAgOXWYcu+OCWdLnCjxyU+hziB0=", "dev": true }, + "uc.micro": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/uc.micro/-/uc.micro-1.0.6.tgz", + "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", + "dev": true + }, "uglify-es": { "version": "3.3.9", "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", @@ -6797,21 +7353,15 @@ } }, "uglify-js": { - "version": "3.4.9", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.4.9.tgz", - "integrity": "sha512-8CJsbKOtEbnJsTyv6LE6m6ZKniqMiFWmm9sRbopbkGs3gMPPfd3Fh8iIA4Ykv5MgaTbqHr4BaoGLJLZNhsrW1Q==", + "version": "3.5.15", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.15.tgz", + "integrity": "sha512-fe7aYFotptIddkwcm6YuA0HmknBZ52ZzOsUxZEdhhkSsz7RfjHDX2QDxwKTiv4JQ5t5NhfmpgAK+J7LiDhKSqg==", "dev": true, "requires": { - "commander": "~2.17.1", + "commander": "~2.20.0", "source-map": "~0.6.1" }, "dependencies": { - "commander": { - "version": "2.17.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.17.1.tgz", - "integrity": "sha512-wPMUt6FnH2yzG95SA6mzjQOEKUU3aLaDEmzs1ti+1E9h+CsrZghRlqEM/EJ4KscsQVG8uNN4uVreUeT8+drlgg==", - "dev": true - }, "source-map": { "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", @@ -6820,36 +7370,12 @@ } } }, - "uglify-to-browserify": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/uglify-to-browserify/-/uglify-to-browserify-1.0.2.tgz", - "integrity": "sha1-bgkk1r2mta/jSeOabWMoUKD4grc=", - "dev": true, - "optional": true - }, "underscore": { - "version": "1.8.3", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.8.3.tgz", - "integrity": "sha1-Tz+1OxBuYJf8+ctBCfKl6b36UCI=", + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.9.1.tgz", + "integrity": "sha512-5/4etnCkd9c8gwgowi5/om/mYO5ajCaOgdzj/oW+0eQV9WxKBDZw5+ycmKmeaTXjInS/W0BzpGLo2xR2aBwZdg==", "dev": true }, - "underscore-contrib": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/underscore-contrib/-/underscore-contrib-0.3.0.tgz", - "integrity": "sha1-ZltmwkeD+PorGMn4y7Dix9SMJsc=", - "dev": true, - "requires": { - "underscore": "1.6.0" - }, - "dependencies": { - "underscore": { - "version": "1.6.0", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.6.0.tgz", - "integrity": "sha1-izixDKze9jM3uLJOT/htRa6lKag=", - "dev": true - } - } - }, "union-value": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/union-value/-/union-value-1.0.0.tgz", @@ -6931,6 +7457,15 @@ } } }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "^2.1.0" + } + }, "urix": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/urix/-/urix-0.1.0.tgz", @@ -7002,9 +7537,9 @@ } }, "walk-back": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-3.0.0.tgz", - "integrity": "sha1-I1h4ejXakQMtrV6S+AsSNw2HlcU=", + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/walk-back/-/walk-back-3.0.1.tgz", + "integrity": "sha512-umiNB2qLO731Sxbp6cfZ9pwURJzTnftxE4Gc7hq8n/ehkuXC//s9F65IEIJA2ZytQZ1ZOsm/Fju4IWx0bivkUQ==", "dev": true }, "walker": { @@ -7016,24 +7551,6 @@ "makeerror": "1.0.x" } }, - "watch": { - "version": "0.18.0", - "resolved": "https://registry.npmjs.org/watch/-/watch-0.18.0.tgz", - "integrity": "sha1-KAlUdsbffJDJYxOJkMClQj60uYY=", - "dev": true, - "requires": { - "exec-sh": "^0.2.0", - "minimist": "^1.2.0" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "http://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", - "dev": true - } - } - }, "webidl-conversions": { "version": "4.0.2", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-4.0.2.tgz", @@ -7081,13 +7598,6 @@ "integrity": "sha1-2e8H3Od7mQK4o6j6SzHD4/fm6Ho=", "dev": true }, - "window-size": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/window-size/-/window-size-0.1.0.tgz", - "integrity": "sha1-VDjNLqk7IC76Ohn+iIeu58lPnJ0=", - "dev": true, - "optional": true - }, "wordwrap": { "version": "0.0.3", "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-0.0.3.tgz", @@ -7169,9 +7679,9 @@ "dev": true }, "xmlcreate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-1.0.2.tgz", - "integrity": "sha1-+mv3YqYKQT+z3Y9LA8WyaSONMI8=", + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/xmlcreate/-/xmlcreate-2.0.1.tgz", + "integrity": "sha512-MjGsXhKG8YjTKrDCXseFo3ClbMGvUD4en29H2Cev1dv4P/chlpw6KdYmlCWDkhosBVKRDjM836+3e3pm1cBNJA==", "dev": true }, "y18n": { @@ -7223,6 +7733,12 @@ "wrap-ansi": "^2.0.0" } }, + "require-main-filename": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/require-main-filename/-/require-main-filename-1.0.1.tgz", + "integrity": "sha1-l/cXtp1IeE9fUmpsWqj/3aBVpNE=", + "dev": true + }, "strip-ansi": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", @@ -7245,9 +7761,9 @@ }, "dependencies": { "camelcase": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.0.0.tgz", - "integrity": "sha512-faqwZqnWxbxn+F1d399ygeamQNy3lPp/H9H6rNrqYh4FSVCtcY+3cub1MxA8o9mDd55mM8Aghuu/kuyYA6VTsA==", + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", "dev": true } } diff --git a/package.json b/package.json index 32f6b78c..6c24899c 100644 --- a/package.json +++ b/package.json @@ -171,22 +171,22 @@ "regenerate:package.json": "node scripts/regenerate-package-json.js" }, "devDependencies": { - "@types/jest": "^24.0.0", - "@types/node": "^10.12.24", + "@types/jest": "^24.0.13", + "@types/node": "^12.0.2", "babel-core": "^6.26.3", "babel-preset-env": "^1.7.0", - "codecov": "^3.1.0", - "fs-extra": "^7.0.1", + "codecov": "^3.5.0", + "fs-extra": "^8.0.1", "fs-readdir-recursive": "^1.1.0", - "jest": "^24.1.0", - "jsdoc-to-markdown": "^4.0.1", + "jest": "^24.8.0", + "jsdoc-to-markdown": "^5.0.0", "pre-commit": "^1.2.2", "rimraf": "^2.6.3", - "ts-jest": "^23.10.5", - "tslint": "^5.12.1", - "typescript": "^3.3.3", + "ts-jest": "^24.0.2", + "tslint": "^5.16.0", + "typescript": "^3.4.5", "uglify-es": "^3.3.9", - "uglify-js": "^3.4.9" + "uglify-js": "^3.5.15" }, "jest": { "moduleFileExtensions": [ From 0242c3ee24fcfd05d578af40113c6e3080ca3c03 Mon Sep 17 00:00:00 2001 From: Ardalan Amini Date: Wed, 5 Jun 2019 23:35:11 +0430 Subject: [PATCH 2/3] WIP --- .prettierrc | 3 + .travis.yml | 6 +- LICENSE | 2 +- docs/README.md | 34 +- package-lock.json | 200 ++++++-- package.json | 19 +- scripts/build.js | 104 ++-- scripts/doc.js | 10 +- src/array/all/index.ts | 5 +- src/array/all/method.ts | 5 +- src/array/all/test.ts | 6 +- src/array/any/index.ts | 5 +- src/array/any/method.ts | 5 +- src/array/any/test.ts | 4 +- src/array/append/index.ts | 2 +- src/array/append/test.ts | 14 +- src/array/average/index.ts | 2 +- src/array/average/method.ts | 5 +- src/array/average/test.ts | 10 +- src/array/chunk/index.ts | 2 +- src/array/chunk/method.ts | 2 +- src/array/chunk/test.ts | 2 +- src/array/clone/index.ts | 2 +- src/array/clone/method.ts | 3 +- src/array/clone/test.ts | 4 +- src/array/compact/index.ts | 2 +- src/array/compact/test.ts | 9 +- src/array/contains/index.ts | 2 +- src/array/contains/method.ts | 2 +- src/array/contains/test.ts | 2 +- src/array/count/index.ts | 2 +- src/array/count/method.ts | 5 +- src/array/count/test.ts | 2 +- src/array/countBy/index.ts | 5 +- src/array/countBy/method.ts | 9 +- src/array/countBy/test.ts | 8 +- src/array/crossJoin/index.ts | 5 +- src/array/crossJoin/method.ts | 5 +- src/array/crossJoin/test.ts | 11 +- src/array/deepFlatten/index.ts | 2 +- src/array/deepFlatten/method.ts | 3 +- src/array/deepFlatten/test.ts | 2 +- src/array/diff/index.ts | 5 +- src/array/diff/method.ts | 8 +- src/array/diff/test.ts | 11 +- src/array/distinct/index.ts | 2 +- src/array/distinct/method.ts | 9 +- src/array/distinct/test.ts | 20 +- src/array/distinctBy/index.ts | 2 +- src/array/distinctBy/method.ts | 2 +- src/array/distinctBy/test.ts | 2 +- src/array/empty/index.ts | 2 +- src/array/empty/test.ts | 2 +- src/array/equals/index.ts | 2 +- src/array/equals/method.ts | 6 +- src/array/equals/test.ts | 23 +- src/array/everyNth/index.ts | 2 +- src/array/everyNth/method.ts | 3 +- src/array/everyNth/test.ts | 5 +- src/array/first/index.ts | 2 +- src/array/first/test.ts | 2 +- src/array/flatten/index.ts | 2 +- src/array/flatten/method.ts | 11 +- src/array/flatten/test.ts | 12 +- src/array/get/index.ts | 2 +- src/array/get/method.ts | 8 +- src/array/get/test.ts | 4 +- src/array/groupBy/index.ts | 6 +- src/array/groupBy/method.ts | 8 +- src/array/groupBy/test.ts | 17 +- src/array/implode/index.ts | 5 +- src/array/implode/method.ts | 7 +- src/array/implode/test.ts | 34 +- src/array/indexOfAll/index.ts | 2 +- src/array/indexOfAll/test.ts | 2 +- src/array/initial/index.ts | 2 +- src/array/initial/test.ts | 2 +- src/array/intersect/index.ts | 2 +- src/array/intersect/method.ts | 2 +- src/array/intersect/test.ts | 2 +- src/array/isEmpty/index.ts | 2 +- src/array/isEmpty/test.ts | 2 +- src/array/last/index.ts | 2 +- src/array/last/test.ts | 2 +- src/array/limit/index.ts | 2 +- src/array/limit/test.ts | 2 +- src/array/max/index.ts | 2 +- src/array/max/method.ts | 6 +- src/array/max/test.ts | 12 +- src/array/median/index.ts | 2 +- src/array/median/method.ts | 3 +- src/array/median/test.ts | 16 +- src/array/merge/index.ts | 2 +- src/array/merge/method.ts | 2 +- src/array/merge/test.ts | 3 +- src/array/methods.ts | 124 ++--- src/array/min/index.ts | 2 +- src/array/min/method.ts | 6 +- src/array/min/test.ts | 12 +- src/array/nest/index.ts | 2 +- src/array/nest/method.ts | 11 +- src/array/nest/test.ts | 2 +- src/array/orderBy/index.ts | 2 +- src/array/orderBy/method.ts | 36 +- src/array/orderBy/test.ts | 12 +- src/array/pad/index.ts | 2 +- src/array/pad/test.ts | 2 +- src/array/partition/index.ts | 11 +- src/array/partition/method.ts | 7 +- src/array/partition/test.ts | 20 +- src/array/pluck/index.ts | 2 +- src/array/pluck/method.ts | 4 +- src/array/pluck/test.ts | 25 +- src/array/prepend/index.ts | 2 +- src/array/prepend/method.ts | 2 +- src/array/prepend/test.ts | 14 +- src/array/pull/index.ts | 2 +- src/array/pull/method.ts | 4 +- src/array/pull/test.ts | 9 +- src/array/range/index.ts | 2 +- src/array/range/method.ts | 7 +- src/array/range/test.ts | 2 +- src/array/repeat/index.ts | 4 +- src/array/repeat/method.ts | 3 +- src/array/repeat/test.ts | 2 +- src/array/sample/index.ts | 2 +- src/array/sample/method.ts | 3 +- src/array/sample/test.ts | 4 +- src/array/shuffle/index.ts | 2 +- src/array/shuffle/test.ts | 2 +- src/array/skip/index.ts | 2 +- src/array/skip/test.ts | 2 +- src/array/sortBy/index.ts | 5 +- src/array/sortBy/method.ts | 5 +- src/array/sortBy/test.ts | 17 +- src/array/sum/index.ts | 2 +- src/array/sum/method.ts | 6 +- src/array/sum/test.ts | 12 +- src/array/tail/index.ts | 2 +- src/array/tail/method.ts | 2 +- src/array/tail/test.ts | 2 +- src/array/toCSV/index.ts | 2 +- src/array/toCSV/method.ts | 4 +- src/array/toCSV/test.ts | 2 +- src/array/union/index.ts | 2 +- src/array/union/method.ts | 3 +- src/array/union/test.ts | 2 +- src/array/unwind/index.ts | 2 +- src/array/unwind/method.ts | 15 +- src/array/unwind/test.ts | 21 +- src/array/where/index.ts | 10 +- src/array/where/method.ts | 97 ++-- src/array/where/test.ts | 44 +- src/array/whereBetween/index.ts | 2 +- src/array/whereBetween/method.ts | 21 +- src/array/whereBetween/test.ts | 10 +- src/array/whereIn/index.ts | 2 +- src/array/whereIn/method.ts | 12 +- src/array/whereIn/test.ts | 10 +- src/array/whereLike/index.ts | 5 +- src/array/whereLike/method.ts | 22 +- src/array/whereLike/test.ts | 25 +- src/array/whereNotBetween/index.ts | 2 +- src/array/whereNotBetween/method.ts | 21 +- src/array/whereNotBetween/test.ts | 14 +- src/array/whereNotIn/index.ts | 2 +- src/array/whereNotIn/method.ts | 12 +- src/array/whereNotIn/test.ts | 10 +- src/array/whereNotLike/index.ts | 2 +- src/array/whereNotLike/method.ts | 22 +- src/array/whereNotLike/test.ts | 19 +- src/array/whereNotNull/index.ts | 5 +- src/array/whereNotNull/method.ts | 4 +- src/array/whereNotNull/test.ts | 17 +- src/array/whereNull/index.ts | 4 +- src/array/whereNull/method.ts | 4 +- src/array/whereNull/test.ts | 15 +- src/array/zip/index.ts | 2 +- src/array/zip/method.ts | 8 +- src/array/zip/test.ts | 16 +- src/array/zipObject/index.ts | 2 +- src/array/zipObject/method.ts | 5 +- src/array/zipObject/test.ts | 12 +- src/boolean/isBoolean/index.ts | 2 +- src/boolean/isBoolean/test.ts | 10 +- src/boolean/methods.ts | 6 +- src/date/equals/index.ts | 2 +- src/date/equals/method.ts | 5 +- src/date/equals/test.ts | 4 +- src/date/isDate/index.ts | 2 +- src/date/isDate/method.ts | 3 +- src/date/isDate/test.ts | 10 +- src/date/methods.ts | 18 +- src/date/today/index.ts | 2 +- src/date/today/method.ts | 8 +- src/date/today/test.ts | 13 +- src/date/tomorrow/index.ts | 2 +- src/date/tomorrow/method.ts | 8 +- src/date/tomorrow/test.ts | 25 +- src/date/yesterday/index.ts | 2 +- src/date/yesterday/method.ts | 8 +- src/date/yesterday/test.ts | 25 +- src/function/cache/index.ts | 5 +- src/function/cache/method.ts | 4 +- src/function/cache/test.ts | 8 +- src/function/defer/index.ts | 2 +- src/function/defer/method.ts | 3 +- src/function/isFunction/index.ts | 2 +- src/function/isFunction/test.ts | 8 +- src/function/methods.ts | 15 +- src/function/once/index.ts | 2 +- src/globals/isBrowser/index.ts | 2 +- src/globals/isBrowser/method.ts | 2 +- src/globals/isBrowser/test.ts | 2 +- src/globals/methods.ts | 6 +- src/math/average/index.ts | 2 +- src/math/average/method.ts | 2 +- src/math/average/test.ts | 5 +- src/math/degreesToRads/index.ts | 2 +- src/math/degreesToRads/test.ts | 5 +- src/math/factorial/index.ts | 2 +- src/math/factorial/method.ts | 2 +- src/math/factorial/test.ts | 5 +- src/math/fibonacci/index.ts | 2 +- src/math/fibonacci/method.ts | 10 +- src/math/fibonacci/test.ts | 5 +- src/math/gcd/index.ts | 2 +- src/math/gcd/test.ts | 5 +- src/math/isDivisible/index.ts | 2 +- src/math/isDivisible/test.ts | 5 +- src/math/isEven/index.ts | 2 +- src/math/isEven/test.ts | 5 +- src/math/isPrime/index.ts | 2 +- src/math/isPrime/test.ts | 8 +- src/math/lcm/index.ts | 2 +- src/math/lcm/method.ts | 5 +- src/math/lcm/test.ts | 5 +- src/math/methods.ts | 22 +- src/math/primes/index.ts | 2 +- src/math/primes/method.ts | 7 +- src/math/primes/test.ts | 5 +- src/math/radsToDegrees/index.ts | 2 +- src/math/radsToDegrees/test.ts | 5 +- src/methods.ts | 12 +- src/number/digitize/index.ts | 2 +- src/number/digitize/method.ts | 2 +- src/number/digitize/test.ts | 2 +- src/number/equals/index.ts | 2 +- src/number/equals/test.ts | 4 +- src/number/inRange/index.ts | 2 +- src/number/inRange/method.ts | 3 +- src/number/inRange/test.ts | 2 +- src/number/isNumber/index.ts | 2 +- src/number/isNumber/method.ts | 3 +- src/number/isNumber/test.ts | 18 +- src/number/methods.ts | 15 +- src/object/assign/index.ts | 2 +- src/object/assign/method.ts | 3 +- src/object/assign/test.ts | 2 +- src/object/camelCaseKeys/index.ts | 2 +- src/object/camelCaseKeys/method.ts | 6 +- src/object/camelCaseKeys/test.ts | 14 +- src/object/clone/index.ts | 2 +- src/object/clone/method.ts | 5 +- src/object/clone/test.ts | 2 +- src/object/defaults/index.ts | 2 +- src/object/defaults/method.ts | 4 +- src/object/defaults/test.ts | 7 +- src/object/dig/index.ts | 2 +- src/object/dig/method.ts | 18 +- src/object/dig/test.ts | 8 +- src/object/empty/index.ts | 2 +- src/object/empty/method.ts | 5 +- src/object/empty/test.ts | 2 +- src/object/equals/index.ts | 2 +- src/object/equals/method.ts | 8 +- src/object/equals/test.ts | 17 +- src/object/flatten/index.ts | 2 +- src/object/flatten/method.ts | 6 +- src/object/flatten/test.ts | 16 +- src/object/forEach/index.ts | 2 +- src/object/forEach/method.ts | 9 +- src/object/forEach/test.ts | 17 +- src/object/get/index.ts | 2 +- src/object/get/method.ts | 4 +- src/object/get/test.ts | 8 +- src/object/invert/index.ts | 2 +- src/object/invert/method.ts | 1 + src/object/invert/test.ts | 10 +- src/object/isEmpty/index.ts | 2 +- src/object/isEmpty/method.ts | 2 +- src/object/isEmpty/test.ts | 2 +- src/object/isObject/index.ts | 2 +- src/object/isObject/test.ts | 6 +- src/object/isObjectLike/index.ts | 2 +- src/object/isObjectLike/method.ts | 2 +- src/object/isObjectLike/test.ts | 6 +- src/object/isPlainObject/index.ts | 2 +- src/object/isPlainObject/method.ts | 5 +- src/object/isPlainObject/test.ts | 6 +- src/object/kebabCaseKeys/index.ts | 2 +- src/object/kebabCaseKeys/method.ts | 6 +- src/object/kebabCaseKeys/test.ts | 14 +- src/object/keys/index.ts | 2 +- src/object/keys/method.ts | 2 +- src/object/keys/test.ts | 11 +- src/object/lowerCaseKeys/index.ts | 2 +- src/object/lowerCaseKeys/method.ts | 4 +- src/object/lowerCaseKeys/test.ts | 11 +- src/object/map/index.ts | 6 +- src/object/map/method.ts | 16 +- src/object/map/test.ts | 18 +- src/object/mapKeys/index.ts | 2 +- src/object/mapKeys/method.ts | 12 +- src/object/mapKeys/test.ts | 7 +- src/object/mapValues/index.ts | 2 +- src/object/mapValues/method.ts | 14 +- src/object/mapValues/test.ts | 18 +- src/object/merge/index.ts | 2 +- src/object/merge/method.ts | 11 +- src/object/merge/test.ts | 18 +- src/object/methods.ts | 56 +- src/object/omit/index.ts | 2 +- src/object/omit/method.ts | 12 +- src/object/omit/test.ts | 10 +- src/object/reduce/index.ts | 7 +- src/object/reduce/method.ts | 15 +- src/object/reduce/test.ts | 20 +- src/object/set/index.ts | 2 +- src/object/set/method.ts | 3 +- src/object/set/test.ts | 3 +- src/object/size/index.ts | 2 +- src/object/size/method.ts | 4 +- src/object/size/test.ts | 5 +- src/object/snakeCaseKeys/index.ts | 2 +- src/object/snakeCaseKeys/method.ts | 6 +- src/object/snakeCaseKeys/test.ts | 14 +- src/object/values/index.ts | 2 +- src/object/values/method.ts | 15 +- src/object/values/test.ts | 5 +- src/string/base64/index.ts | 2 +- src/string/base64/test.ts | 7 +- src/string/base64Decode/index.ts | 2 +- src/string/base64Decode/test.ts | 7 +- src/string/camelCase/index.ts | 2 +- src/string/camelCase/method.ts | 8 +- src/string/camelCase/test.ts | 48 +- src/string/capitalize/index.ts | 2 +- src/string/capitalize/method.ts | 4 +- src/string/capitalize/test.ts | 12 +- src/string/chars/index.ts | 2 +- src/string/chars/test.ts | 7 +- src/string/contains/index.ts | 2 +- src/string/contains/test.ts | 12 +- src/string/decapitalize/index.ts | 2 +- src/string/decapitalize/method.ts | 4 +- src/string/decapitalize/test.ts | 12 +- src/string/equals/index.ts | 2 +- src/string/equals/test.ts | 6 +- src/string/forEach/index.ts | 3 +- src/string/forEach/method.ts | 6 +- src/string/forEach/test.ts | 4 +- src/string/humanize/index.ts | 5 +- src/string/humanize/method.ts | 12 +- src/string/humanize/test.ts | 19 +- src/string/isEmpty/index.ts | 2 +- src/string/isEmpty/test.ts | 6 +- src/string/isString/index.ts | 2 +- src/string/isString/test.ts | 10 +- src/string/kebabCase/index.ts | 3 +- src/string/kebabCase/method.ts | 11 +- src/string/kebabCase/test.ts | 57 ++- src/string/lines/index.ts | 2 +- src/string/lines/test.ts | 17 +- src/string/map/index.ts | 4 +- src/string/map/method.ts | 10 +- src/string/map/test.ts | 7 +- src/string/mask/index.ts | 2 +- src/string/mask/method.ts | 3 +- src/string/mask/test.ts | 17 +- src/string/methods.ts | 52 +- src/string/pad/index.ts | 2 +- src/string/pad/method.ts | 2 +- src/string/pad/test.ts | 8 +- src/string/parseInt/index.ts | 2 +- src/string/parseInt/method.ts | 3 +- src/string/parseInt/test.ts | 4 +- src/string/pluralize/index.ts | 2 +- src/string/pluralize/method.ts | 284 ++++++++--- src/string/pluralize/test.ts | 765 ++++++++++++++++++++++------ src/string/reduce/index.ts | 7 +- src/string/reduce/method.ts | 2 +- src/string/reduce/test.ts | 6 +- src/string/repeat/index.ts | 2 +- src/string/repeat/method.ts | 5 +- src/string/repeat/test.ts | 6 +- src/string/reverse/index.ts | 2 +- src/string/reverse/test.ts | 7 +- src/string/snakeCase/index.ts | 3 +- src/string/snakeCase/method.ts | 11 +- src/string/snakeCase/test.ts | 55 +- src/string/swapCase/index.ts | 2 +- src/string/swapCase/method.ts | 5 +- src/string/swapCase/test.ts | 7 +- src/string/truncate/index.ts | 2 +- src/string/truncate/method.ts | 4 +- src/string/truncate/test.ts | 22 +- src/string/words/index.ts | 2 +- src/string/words/method.ts | 3 +- src/string/words/test.ts | 16 +- src/types.ts | 1 - src/utils.test.ts | 12 +- src/utils.ts | 69 ++- tsconfig.json | 75 ++- tslint.bkp.json | 87 ++++ tslint.json | 93 +--- 416 files changed, 2983 insertions(+), 1749 deletions(-) create mode 100644 .prettierrc delete mode 100644 src/types.ts create mode 100644 tslint.bkp.json diff --git a/.prettierrc b/.prettierrc new file mode 100644 index 00000000..bf357fbb --- /dev/null +++ b/.prettierrc @@ -0,0 +1,3 @@ +{ + "trailingComma": "all" +} diff --git a/.travis.yml b/.travis.yml index 87740706..9162eafc 100644 --- a/.travis.yml +++ b/.travis.yml @@ -5,9 +5,11 @@ os: - osx node_js: - - "10" - - "9" - "8" + - "9" + - "10" + - "11" + - "12" script: - npm run codecov diff --git a/LICENSE b/LICENSE index 6f5605d2..78cdb065 100644 --- a/LICENSE +++ b/LICENSE @@ -1,6 +1,6 @@ MIT License -Copyright (c) 2018 Ardalan Amini +Copyright (c) 2018-2019 Ardalan Amini Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal diff --git a/docs/README.md b/docs/README.md index cd5d9ada..5c0f4863 100644 --- a/docs/README.md +++ b/docs/README.md @@ -100,7 +100,8 @@ ### array.all([fn]) ⇒ [Boolean](#Boolean) -Returns `true` if the provided predicate function returns `true` for all elements in a collection, `false` otherwise +Returns `true` if the provided predicate function +returns `true` for all elements in a collection,`false` otherwise **Kind**: instance method of [Array](#Array) @@ -116,7 +117,8 @@ Returns `true` if the provided predicate function returns `true` for all element ### array.any([fn]) ⇒ [Boolean](#Boolean) -Returns `true` if the provided predicate function returns `true` for at least one element in a collection, +Returns `true` if the provided predicate function +returns `true` for at least one element in a collection, `false` otherwise **Kind**: instance method of [Array](#Array) @@ -254,7 +256,8 @@ Counts the occurrences of a value in an array ### array.countBy(fn) ⇒ [Object](#Object) -Groups the elements of an array based on the given function and returns the count of elements in each group +Groups the elements of an array based on the given function and +returns the count of elements in each group **Kind**: instance method of [Array](#Array) @@ -270,7 +273,8 @@ Groups the elements of an array based on the given function and returns the coun ### array.crossJoin(array) ⇒ [Array.<Array>](#Array) -Cross joins the array's values among the given arrays, returning a Cartesian product with all possible permutations +Cross joins the array's values among the given arrays, +returning a Cartesian product with all possible permutations **Kind**: instance method of [Array](#Array) @@ -296,7 +300,8 @@ Deep flattens an array ### array.diff(array, [comp]) ⇒ [Array](#Array) Returns the difference between this and another array -if `comp` is given, filters out all values from an array for which the comparator function does not return true +if `comp` is given, filters out all values from an array for which the comparator function +does not return true **Kind**: instance method of [Array](#Array) @@ -452,7 +457,8 @@ It's like join but u get to git it which keys to join **Example** ```javascript -[{a: {b: 'first'}}, {a: {b: 'second'}}, {a: {b: 'third'}}].implode('a.b', ', '); // 'first, second, third' +[{a: {b: 'first'}}, {a: {b: 'second'}}, {a: {b: 'third'}}].implode('a.b', ', '); +// 'first, second, third' ``` @@ -673,7 +679,8 @@ FillS the array with the given value until the array reaches the specified size ### array.partition(fn) ⇒ [Array](#Array) -Groups the elements into two arrays, depending on the provided function's truthiness for each element +Groups the elements into two arrays, +depending on the provided function's truthiness for each element **Kind**: instance method of [Array](#Array) @@ -683,7 +690,9 @@ Groups the elements into two arrays, depending on the provided function's truthi **Example** ```javascript -const users = [{ user: 'barney', age: 36, active: false }, { user: 'fred', age: 40, active: true }]; +const users = [ + { user: 'barney', age: 36, active: false }, { user: 'fred', age: 40, active: true } +]; users.partition(o => o.active); // [ [{ 'user': 'fred', 'age': 40, 'active': true }], [{ 'user': 'barney', 'age': 36, 'active': false }] @@ -791,7 +800,8 @@ An alias of Array.prototype.skip ### array.sortBy(fn) ⇒ [Array](#Array) -Groups the elements of an array based on the given function and returns the count of elements in each group +Groups the elements of an array based on the given function and +returns the count of elements in each group **Kind**: instance method of [Array](#Array) @@ -948,7 +958,8 @@ Filters the array **Example** ```javascript ["foo", "bar", "hello", "world"].whereLike("o"); // ["foo","hello","world"] -[{foo:"hello"}, {foo:"bar"}, {foo:"world"}].whereLike("foo", /o/i); // [{foo:"hello"},{foo:"world"}] +[{foo:"hello"}, {foo:"bar"}, {foo:"world"}] + .whereLike("foo", /o/i); // [{foo:"hello"},{foo:"world"}] ``` @@ -2186,7 +2197,8 @@ Also removes beginning and ending whitespace **Kind**: instance method of [String](#String) **Example** ```javascript -' capitalize dash-CamelCase_underscore trim '.humanize(); // 'Capitalize dash camel case underscore trim' +' capitalize dash-CamelCase_underscore trim '.humanize(); +// 'Capitalize dash camel case underscore trim' ``` diff --git a/package-lock.json b/package-lock.json index 5368e8c0..4eb28893 100644 --- a/package-lock.json +++ b/package-lock.json @@ -309,6 +309,46 @@ } } }, + "@fimbul/bifrost": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@fimbul/bifrost/-/bifrost-0.17.0.tgz", + "integrity": "sha512-gVTkJAOef5HtN6LPmrtt5fAUmBywwlgmObsU3FBhPoNeXPLaIl2zywXkJEtvvVLQnaFmtff3x+wIj5lHRCDE3Q==", + "dev": true, + "requires": { + "@fimbul/ymir": "^0.17.0", + "get-caller-file": "^2.0.0", + "tslib": "^1.8.1", + "tsutils": "^3.5.0" + }, + "dependencies": { + "get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "dev": true + }, + "tsutils": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.14.0.tgz", + "integrity": "sha512-SmzGbB0l+8I0QwsPgjooFRaRvHLBLNYM8SeQ0k6rtNDru5sCGeLJcZdwilNndN+GysuFjF5EIYgN8GfFG6UeUw==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "@fimbul/ymir": { + "version": "0.17.0", + "resolved": "https://registry.npmjs.org/@fimbul/ymir/-/ymir-0.17.0.tgz", + "integrity": "sha512-xMXM9KTXRLHLVS6dnX1JhHNEkmWHcAVCQ/4+DA1KKwC/AFnGHzu/7QfQttEPgw3xplT+ILf9e3i64jrFwB3JtA==", + "dev": true, + "requires": { + "inversify": "^5.0.0", + "reflect-metadata": "^0.1.12", + "tslib": "^1.8.1" + } + }, "@jest/console": { "version": "24.7.1", "resolved": "https://registry.npmjs.org/@jest/console/-/console-24.7.1.tgz", @@ -752,9 +792,9 @@ "dev": true }, "@types/node": { - "version": "12.0.2", - "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.2.tgz", - "integrity": "sha512-5tabW/i+9mhrfEOUcLDu2xBPsHJ+X5Orqy9FKpale3SjDA17j5AEpYq5vfy3oAeAHGcvANRCO3NV3d2D6q3NiA==", + "version": "12.0.4", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.0.4.tgz", + "integrity": "sha512-j8YL2C0fXq7IONwl/Ud5Kt0PeXw22zGERt+HSSnwbKOJVsAGkEz3sFCYwaF9IOuoG1HOtE0vKCj6sXF7Q0+Vaw==", "dev": true }, "@types/stack-utils": { @@ -2397,6 +2437,30 @@ } } }, + "doctrine": { + "version": "0.7.2", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-0.7.2.tgz", + "integrity": "sha1-fLhgNZujvpDgQLJrcpzkv6ZUxSM=", + "dev": true, + "requires": { + "esutils": "^1.1.6", + "isarray": "0.0.1" + }, + "dependencies": { + "esutils": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-1.1.6.tgz", + "integrity": "sha1-wBzKqa5LiXxtDD4hCuUvPHqEQ3U=", + "dev": true + }, + "isarray": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-0.0.1.tgz", + "integrity": "sha1-ihis/Kmo9Bd+Cav8YDiTmwXR7t8=", + "dev": true + } + } + }, "domexception": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/domexception/-/domexception-1.0.1.tgz", @@ -3744,6 +3808,12 @@ "loose-envify": "^1.0.0" } }, + "inversify": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/inversify/-/inversify-5.0.1.tgz", + "integrity": "sha512-Ieh06s48WnEYGcqHepdsJUIJUXpwH5o5vodAX+DK2JA/gjy4EbEcQZxw+uFfzysmKjiLXGYwNG3qDZsKVMcINQ==", + "dev": true + }, "invert-kv": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/invert-kv/-/invert-kv-2.0.0.tgz", @@ -6211,6 +6281,12 @@ } } }, + "reflect-metadata": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/reflect-metadata/-/reflect-metadata-0.1.13.tgz", + "integrity": "sha512-Ts1Y/anZELhSsjMcU605fU9RE4Oi3p5ORujwbIKXfWa+0Zxs510Qrmrce5/Jowq3cHSZSJqBjypxmHarc+vEWg==", + "dev": true + }, "regenerate": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", @@ -7220,9 +7296,9 @@ "dev": true }, "tslint": { - "version": "5.16.0", - "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.16.0.tgz", - "integrity": "sha512-UxG2yNxJ5pgGwmMzPMYh/CCnCnh0HfPgtlVRDs1ykZklufFBL1ZoTlWFRz2NQjcoEiDoRp+JyT0lhBbbH/obyA==", + "version": "5.17.0", + "resolved": "https://registry.npmjs.org/tslint/-/tslint-5.17.0.tgz", + "integrity": "sha512-pflx87WfVoYepTet3xLfDOLDm9Jqi61UXIKePOuca0qoAZyrGWonDG9VTbji58Fy+8gciUn8Bt7y69+KEVjc/w==", "dev": true, "requires": { "@babel/code-frame": "^7.0.0", @@ -7231,7 +7307,7 @@ "commander": "^2.12.1", "diff": "^3.2.0", "glob": "^7.1.1", - "js-yaml": "^3.13.0", + "js-yaml": "^3.13.1", "minimatch": "^3.0.4", "mkdirp": "^0.5.1", "resolve": "^1.3.2", @@ -7271,6 +7347,76 @@ } } }, + "tslint-config-airbnb": { + "version": "5.11.1", + "resolved": "https://registry.npmjs.org/tslint-config-airbnb/-/tslint-config-airbnb-5.11.1.tgz", + "integrity": "sha512-hkaittm2607vVMe8eotANGN1CimD5tor7uoY3ypg2VTtEcDB/KGWYbJOz58t8LI4cWSyWtgqYQ5F0HwKxxhlkQ==", + "dev": true, + "requires": { + "tslint-consistent-codestyle": "^1.14.1", + "tslint-eslint-rules": "^5.4.0", + "tslint-microsoft-contrib": "~5.2.1" + } + }, + "tslint-consistent-codestyle": { + "version": "1.15.1", + "resolved": "https://registry.npmjs.org/tslint-consistent-codestyle/-/tslint-consistent-codestyle-1.15.1.tgz", + "integrity": "sha512-38Y3Dz4zcABe/PlPAQSGNEWPGVq0OzcIQR7SEU6dNujp/SgvhxhJOhIhI9gY4r0I3/TNtvVQwARWor9O9LPZWg==", + "dev": true, + "requires": { + "@fimbul/bifrost": "^0.17.0", + "tslib": "^1.7.1", + "tsutils": "^2.29.0" + } + }, + "tslint-eslint-rules": { + "version": "5.4.0", + "resolved": "https://registry.npmjs.org/tslint-eslint-rules/-/tslint-eslint-rules-5.4.0.tgz", + "integrity": "sha512-WlSXE+J2vY/VPgIcqQuijMQiel+UtmXS+4nvK4ZzlDiqBfXse8FAvkNnTcYhnQyOTW5KFM+uRRGXxYhFpuBc6w==", + "dev": true, + "requires": { + "doctrine": "0.7.2", + "tslib": "1.9.0", + "tsutils": "^3.0.0" + }, + "dependencies": { + "tslib": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.0.tgz", + "integrity": "sha512-f/qGG2tUkrISBlQZEjEqoZ3B2+npJjIf04H1wuAv9iA8i04Icp+61KRXxFdha22670NJopsZCIjhC3SnjPRKrQ==", + "dev": true + }, + "tsutils": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-3.14.0.tgz", + "integrity": "sha512-SmzGbB0l+8I0QwsPgjooFRaRvHLBLNYM8SeQ0k6rtNDru5sCGeLJcZdwilNndN+GysuFjF5EIYgN8GfFG6UeUw==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } + } + }, + "tslint-microsoft-contrib": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/tslint-microsoft-contrib/-/tslint-microsoft-contrib-5.2.1.tgz", + "integrity": "sha512-PDYjvpo0gN9IfMULwKk0KpVOPMhU6cNoT9VwCOLeDl/QS8v8W2yspRpFFuUS7/c5EIH/n8ApMi8TxJAz1tfFUA==", + "dev": true, + "requires": { + "tsutils": "^2.27.2 <2.29.0" + }, + "dependencies": { + "tsutils": { + "version": "2.28.0", + "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.28.0.tgz", + "integrity": "sha512-bh5nAtW0tuhvOJnx1GLRn5ScraRLICGyJV5wJhtRWOLsxW70Kk5tZtpK3O/hW6LDnqKS9mlUMPZj9fEMJ0gxqA==", + "dev": true, + "requires": { + "tslib": "^1.8.1" + } + } + } + }, "tsutils": { "version": "2.29.0", "resolved": "https://registry.npmjs.org/tsutils/-/tsutils-2.29.0.tgz", @@ -7311,9 +7457,9 @@ "dev": true }, "typescript": { - "version": "3.4.5", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.4.5.tgz", - "integrity": "sha512-YycBxUb49UUhdNMU5aJ7z5Ej2XGmaIBL0x34vZ82fn3hGvD+bgrMrVDpatgz2f7YxUMJxMkbWxJZeAvDxVe7Vw==", + "version": "3.5.1", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.5.1.tgz", + "integrity": "sha512-64HkdiRv1yYZsSe4xC1WVgamNigVYjlssIoaH2HcZF0+ijsk5YK2g0G34w9wJkze8+5ow4STd22AynfO6ZYYLw==", "dev": true }, "typical": { @@ -7328,35 +7474,12 @@ "integrity": "sha512-8Y75pvTYkLJW2hWQHXxoqRgV7qb9B+9vFEtidML+7koHUFapnVJAZ6cKs+Qjz5Aw3aZWHMC6u0wJE3At+nSGwA==", "dev": true }, - "uglify-es": { - "version": "3.3.9", - "resolved": "https://registry.npmjs.org/uglify-es/-/uglify-es-3.3.9.tgz", - "integrity": "sha512-r+MU0rfv4L/0eeW3xZrd16t4NZfK8Ld4SWVglYBb7ez5uXFWHuVRs6xCTrf1yirs9a4j4Y27nn7SRfO6v67XsQ==", - "dev": true, - "requires": { - "commander": "~2.13.0", - "source-map": "~0.6.1" - }, - "dependencies": { - "commander": { - "version": "2.13.0", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.13.0.tgz", - "integrity": "sha512-MVuS359B+YzaWqjCL/c+22gfryv+mCBPHAv3zyVI2GN8EY6IRP8VwtasXn8jyyhvvq84R4ImN1OKRtcbIasjYA==", - "dev": true - }, - "source-map": { - "version": "0.6.1", - "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", - "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true - } - } - }, "uglify-js": { - "version": "3.5.15", - "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.5.15.tgz", - "integrity": "sha512-fe7aYFotptIddkwcm6YuA0HmknBZ52ZzOsUxZEdhhkSsz7RfjHDX2QDxwKTiv4JQ5t5NhfmpgAK+J7LiDhKSqg==", + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/uglify-js/-/uglify-js-3.6.0.tgz", + "integrity": "sha512-W+jrUHJr3DXKhrsS7NUVxn3zqMOFn0hL/Ei6v0anCIMoKC93TjcflTagwIHLW7SfMFfiQuktQyFVCFHGUE0+yg==", "dev": true, + "optional": true, "requires": { "commander": "~2.20.0", "source-map": "~0.6.1" @@ -7366,7 +7489,8 @@ "version": "0.6.1", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", - "dev": true + "dev": true, + "optional": true } } }, diff --git a/package.json b/package.json index 6c24899c..0833b818 100644 --- a/package.json +++ b/package.json @@ -2,7 +2,11 @@ "name": "prototyped.js", "version": "1.0.0", "description": "Common typescript ready prototypes available in both es5 and es6", - "author": "Ardalan Amini [https://ardalanamini.com]", + "author": { + "name": "Ardalan Amini", + "email": "ardalanamini22@gmail.com", + "url": "https://ardalanamini.com" + }, "license": "MIT", "homepage": "https://prototyped.js.org", "repository": { @@ -90,7 +94,7 @@ "today", "tomorrow", "yesterday", - "function", + "func", "cache", "defer", "isFunction", @@ -163,6 +167,8 @@ "scripts": { "prepublishOnly": "npm test && npm run lint && npm run doc && npm run build && npm run regenerate:package.json", "build": "node scripts/build.js", + "build:tsc": "tsc", + "watch:tsc": "npm run build:tsc -- --watch", "doc": "node scripts/doc.js", "lint": "tslint -p tsconfig.json -c tslint.json --exclude '**/*.d.ts'", "test": "jest", @@ -172,7 +178,7 @@ }, "devDependencies": { "@types/jest": "^24.0.13", - "@types/node": "^12.0.2", + "@types/node": "^12.0.4", "babel-core": "^6.26.3", "babel-preset-env": "^1.7.0", "codecov": "^3.5.0", @@ -183,10 +189,9 @@ "pre-commit": "^1.2.2", "rimraf": "^2.6.3", "ts-jest": "^24.0.2", - "tslint": "^5.16.0", - "typescript": "^3.4.5", - "uglify-es": "^3.3.9", - "uglify-js": "^3.5.15" + "tslint": "^5.17.0", + "tslint-config-airbnb": "^5.11.1", + "typescript": "^3.5.1" }, "jest": { "moduleFileExtensions": [ diff --git a/scripts/build.js b/scripts/build.js index f5db12ec..45717bfd 100755 --- a/scripts/build.js +++ b/scripts/build.js @@ -1,81 +1,69 @@ #!/usr/bin/env node -const path = require('path') -const rimraf = require('rimraf') -const {spawn} = require('child_process') -const fs = require('fs') -const fse = require('fs-extra') -const readdir = require('fs-readdir-recursive') -const babel = require('babel-core') -const UglifyJs = require('uglify-js') -const UglifyEs = require('uglify-es') +const path = require("path"); +const rimraf = require("rimraf"); +const { spawn } = require("child_process"); +const fs = require("fs"); +const fse = require("fs-extra"); +const readdir = require("fs-readdir-recursive"); +const babel = require("babel-core"); -const startTime = new Date().getTime() +const startTime = new Date().getTime(); -const es6Dir = path.join(__dirname, '..', 'es6') -const es5Dir = path.join(__dirname, '..', 'es5') +const es6Dir = path.join(__dirname, "..", "es6"); +const es5Dir = path.join(__dirname, "..", "es5"); -rimraf.sync(es6Dir) -rimraf.sync(es5Dir) +rimraf.sync(es6Dir); +rimraf.sync(es5Dir); -const tsc = spawn(path.join(__dirname, '..', 'node_modules', '.bin', 'tsc')) +const tsc = spawn(path.join(__dirname, "..", "node_modules", ".bin", "tsc")); -tsc.stdout.on('data', (data) => console.log(`stdout: ${data}`)) +tsc.stdout.on("data", data => console.log(`stdout: ${data}`)); -tsc.stderr.on('data', (data) => console.log(`stderr: ${data}`)) +tsc.stderr.on("data", data => console.log(`stderr: ${data}`)); -tsc.on('close', (code) => { - const dtsFileNames = readdir(es6Dir, (filename) => filename.indexOf('.') === -1 || /\.d\.ts$/.test(filename)) +tsc.on("close", code => { + const dtsFileNames = readdir( + es6Dir, + filename => filename.indexOf(".") === -1 || /\.d\.ts$/.test(filename), + ); - fs.mkdirSync(es5Dir) + fs.mkdirSync(es5Dir); - dtsFileNames.forEach((filename) => { - let distPath = path.join(es5Dir, filename) + dtsFileNames.forEach(filename => { + let distPath = path.join(es5Dir, filename); - if (!fs.existsSync(path.dirname(distPath))) fse.mkdirsSync(path.dirname(distPath)) + if (!fs.existsSync(path.dirname(distPath))) + fse.mkdirsSync(path.dirname(distPath)); - fs.copyFileSync(path.join(es6Dir, filename), distPath) - }) + fs.copyFileSync(path.join(es6Dir, filename), distPath); + }); - const es5FileNames = readdir(es6Dir, (filename) => /(? /(? { - let filePath = path.join(es6Dir, filename) - let distPath = path.join(es5Dir, filename) - let content = fs.readFileSync(filePath, 'utf8') - - content = content.replace('Object.defineProperty(exports, "__esModule", { value: true });', '') + es5FileNames.forEach(filename => { + let filePath = path.join(es6Dir, filename); + let distPath = path.join(es5Dir, filename); + let content = fs.readFileSync(filePath, "utf8"); content = babel.transform(content, { - presets: 'env' - }) - - content = UglifyJs.minify(content.code, { - toplevel: true, - }) - - if (content.error) throw new Error(content.error) - - fs.writeFileSync(distPath, content.code, 'utf8') - }) - - const es6FileNames = readdir(es6Dir, (filename) => /(? { - let filePath = path.join(es6Dir, filename) - let content = fs.readFileSync(filePath, 'utf8') + if (content.error) throw new Error(content.error); - content = content.replace('Object.defineProperty(exports, "__esModule", { value: true });', '') + fs.writeFileSync(distPath, content.code, "utf8"); + }); - content = UglifyEs.minify(content, { - toplevel: true, - }) + const es6FileNames = readdir(es6Dir, filename => /(? { + const filePath = path.join(es6Dir, filename); - fs.writeFileSync(filePath, content.code, 'utf8') - }) + fs.writeFileSync(filePath, fs.readFileSync(filePath, "utf8"), "utf8"); + }); - if (code === 0) console.log(`finished in ${new Date().getTime() - startTime}ms`) - else console.log(`child process exited with code ${code}`) -}) + if (code === 0) + console.log(`finished in ${new Date().getTime() - startTime}ms`); + else console.log(`child process exited with code ${code}`); +}); diff --git a/scripts/doc.js b/scripts/doc.js index 547e92a3..43112d94 100644 --- a/scripts/doc.js +++ b/scripts/doc.js @@ -1,7 +1,7 @@ #!/usr/bin/env node const path = require("path"); -const rimraf = require("rimraf"); +// const rimraf = require("rimraf"); const {execSync} = require("child_process"); const fs = require("fs"); @@ -10,12 +10,12 @@ const startTime = new Date().getTime(); const DOCS_DIR = path.resolve(__dirname, "..", "docs"); const DOCS_PATH = path.resolve(DOCS_DIR, "README.md"); -rimraf.sync(DOCS_DIR); +// rimraf.sync(DOCS_DIR); -fs.mkdirSync(DOCS_DIR); +// fs.mkdirSync(DOCS_DIR); -fs.writeFileSync(path.resolve(DOCS_DIR, "CNAME"), "prototyped.js.org", "utf8"); -fs.writeFileSync(path.resolve(DOCS_DIR, "_config.yml"), "theme: jekyll-theme-cayman", "utf8"); +// fs.writeFileSync(path.resolve(DOCS_DIR, "CNAME"), "prototyped.js.org", "utf8"); +// fs.writeFileSync(path.resolve(DOCS_DIR, "_config.yml"), "theme: jekyll-theme-cayman", "utf8"); execSync(path.resolve(__dirname, "..", "node_modules", ".bin", "tsc")); diff --git a/src/array/all/index.ts b/src/array/all/index.ts index 8611dba3..b973efe5 100644 --- a/src/array/all/index.ts +++ b/src/array/all/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { @@ -8,7 +8,8 @@ declare global { } /** - * Returns `true` if the provided predicate function returns `true` for all elements in a collection, `false` otherwise + * Returns `true` if the provided predicate function + * returns `true` for all elements in a collection,`false` otherwise * @memberof Array.prototype * @function all * @param {Function} [fn=Boolean] diff --git a/src/array/all/method.ts b/src/array/all/method.ts index adece748..50ea4e4f 100644 --- a/src/array/all/method.ts +++ b/src/array/all/method.ts @@ -1,3 +1,6 @@ -const all = (arr: T[], fn: (value: T, index: number, array: T[]) => boolean = Boolean) => arr.every(fn); +const all = ( + arr: T[], + fn: (value: T, index: number, array: T[]) => boolean = Boolean, +) => arr.every(fn); export = all; diff --git a/src/array/all/test.ts b/src/array/all/test.ts index 10fdc8e5..6f4a1c20 100644 --- a/src/array/all/test.ts +++ b/src/array/all/test.ts @@ -1,12 +1,12 @@ -import "./index"; +import "."; describe("Array.prototype.all", () => { test("[4, 2, 3].all((x) => x > 1) returns true", () => { - expect([4, 2, 3].all((x) => x > 1)).toBe(true); + expect([4, 2, 3].all(x => x > 1)).toBe(true); }); test("[4, 2, 3].all((x) => x > 2) returns false", () => { - expect([4, 2, 3].all((x) => x > 2)).toBe(false); + expect([4, 2, 3].all(x => x > 2)).toBe(false); }); test("[1, 2, 3].all() returns true", () => { diff --git a/src/array/any/index.ts b/src/array/any/index.ts index d58c6409..7c80ef49 100644 --- a/src/array/any/index.ts +++ b/src/array/any/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { @@ -8,7 +8,8 @@ declare global { } /** - * Returns `true` if the provided predicate function returns `true` for at least one element in a collection, + * Returns `true` if the provided predicate function + * returns `true` for at least one element in a collection, * `false` otherwise * @memberof Array.prototype * @function any diff --git a/src/array/any/method.ts b/src/array/any/method.ts index 8e83d5c2..c74ccf11 100644 --- a/src/array/any/method.ts +++ b/src/array/any/method.ts @@ -1,3 +1,6 @@ -const method = (arr: T[], fn: (value: T, index: number, array: T[]) => boolean = Boolean) => arr.some(fn); +const method = ( + arr: T[], + fn: (value: T, index: number, array: T[]) => boolean = Boolean, +) => arr.some(fn); export = method; diff --git a/src/array/any/test.ts b/src/array/any/test.ts index d494388b..287648eb 100644 --- a/src/array/any/test.ts +++ b/src/array/any/test.ts @@ -1,8 +1,8 @@ -import "./index"; +import "."; describe("Array.prototype.any", () => { test("[0, 1, 2, 0].any((x) => x >= 2) returns true", () => { - expect([0, 1, 2, 0].any((x) => x >= 2)).toBe(true); + expect([0, 1, 2, 0].any(x => x >= 2)).toBe(true); }); test("[0, 0, 0].any() returns false", () => { diff --git a/src/array/append/index.ts b/src/array/append/index.ts index 370652f7..31f09e22 100644 --- a/src/array/append/index.ts +++ b/src/array/append/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/append/test.ts b/src/array/append/test.ts index 89288d93..b8fb412b 100644 --- a/src/array/append/test.ts +++ b/src/array/append/test.ts @@ -1,13 +1,15 @@ -import "./index"; +import "."; describe("Array.prototype.append", () => { test("myArray = [1, 2, 3] & myArray.append(0) results myArray to be [1, 2, 3, 0]", () => { - expect((() => { - const myArray = [1, 2, 3]; + expect( + (() => { + const myArray = [1, 2, 3]; - myArray.append(0); + myArray.append(0); - return myArray; - })()).toEqual([1, 2, 3, 0]); + return myArray; + })(), + ).toEqual([1, 2, 3, 0]); }); }); diff --git a/src/array/average/index.ts b/src/array/average/index.ts index e0fd913b..2afb813f 100644 --- a/src/array/average/index.ts +++ b/src/array/average/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/average/method.ts b/src/array/average/method.ts index bddc9fb0..f789c34c 100644 --- a/src/array/average/method.ts +++ b/src/array/average/method.ts @@ -1,5 +1,6 @@ -import * as sum from "../sum/method"; +import sum from "../sum/method"; -const method = (arr: T[], path?: string) => sum(arr, path) / arr.length; +const method = (arr: T[], path?: string) => + sum(arr, path) / arr.length; export = method; diff --git a/src/array/average/test.ts b/src/array/average/test.ts index e15c739e..1df0a6e2 100644 --- a/src/array/average/test.ts +++ b/src/array/average/test.ts @@ -1,15 +1,17 @@ -import "./index"; +import "."; describe("Array.prototype.average", () => { test("[1, 2, 3].average() returns 2", () => { expect([1, 2, 3].average()).toBe(2); }); - test("[{a: 1}, {a: 2}, {a: 3}].average(\"a\") returns 2", () => { + test('[{a: 1}, {a: 2}, {a: 3}].average("a") returns 2', () => { expect([{ a: 1 }, { a: 2 }, { a: 3 }].average("a")).toBe(2); }); - test("[{a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}].average(\"a.b\") returns 2", () => { - expect([{ a: { b: 1 } }, { a: { b: 2 } }, { a: { b: 3 } }].average("a.b")).toBe(2); + test('[{a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}].average("a.b") returns 2', () => { + expect( + [{ a: { b: 1 } }, { a: { b: 2 } }, { a: { b: 3 } }].average("a.b"), + ).toBe(2); }); }); diff --git a/src/array/chunk/index.ts b/src/array/chunk/index.ts index 55420fd7..b9a960a2 100644 --- a/src/array/chunk/index.ts +++ b/src/array/chunk/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/chunk/method.ts b/src/array/chunk/method.ts index f9f9a63d..522ef606 100644 --- a/src/array/chunk/method.ts +++ b/src/array/chunk/method.ts @@ -3,7 +3,7 @@ const method = (arr: T[], size: number): T[][] => { { length: Math.ceil(arr.length / size), }, - (value, index) => arr.slice(index * size, index * size + size) + (value, index) => arr.slice(index * size, index * size + size), ); }; diff --git a/src/array/chunk/test.ts b/src/array/chunk/test.ts index bbfaadb0..5c6dc3d1 100644 --- a/src/array/chunk/test.ts +++ b/src/array/chunk/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.chunk", () => { test("[1, 2, 3, 4, 5].chunk(2) returns [[1,2],[3,4],[5]]", () => { diff --git a/src/array/clone/index.ts b/src/array/clone/index.ts index ffd4c7c7..29c39872 100644 --- a/src/array/clone/index.ts +++ b/src/array/clone/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/clone/method.ts b/src/array/clone/method.ts index 9e4c0940..b4d23f18 100644 --- a/src/array/clone/method.ts +++ b/src/array/clone/method.ts @@ -1,5 +1,6 @@ import { deepClone } from "../../utils"; -const method = (arr: T[], deep = false): T[] => deep ? deepClone(arr) : [...arr]; +const method = (arr: T[], deep = false): T[] => + deep ? deepClone(arr) : [...arr]; export = method; diff --git a/src/array/clone/test.ts b/src/array/clone/test.ts index 65af4e6d..934cf0d9 100644 --- a/src/array/clone/test.ts +++ b/src/array/clone/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.clone", () => { test("[].clone() returns []", () => { @@ -24,7 +24,7 @@ describe("Array.prototype.clone", () => { expect(a).not.toEqual(b); }); - test("[1, { foo: \"bar\" }, 3].clone(true) returns [1, { foo: \"bar\" }, 3]", () => { + test('[1, { foo: "bar" }, 3].clone(true) returns [1, { foo: "bar" }, 3]', () => { const a = [1, { foo: "bar" }, 3]; const b = a.clone(true); diff --git a/src/array/compact/index.ts b/src/array/compact/index.ts index 01a8bd61..6928b138 100644 --- a/src/array/compact/index.ts +++ b/src/array/compact/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/compact/test.ts b/src/array/compact/test.ts index 78af3921..c84c95fe 100644 --- a/src/array/compact/test.ts +++ b/src/array/compact/test.ts @@ -1,8 +1,9 @@ -import "./index"; +import "."; describe("Array.prototype.compact", () => { - test("[0,1,false,2,\"\",3,\"a\",\"e\" * 23,NaN,\"s\",34].compact() returns [1,2,3,\"a\",\"s\",34]", () => { - expect([0, 1, false, 2, "", 3, "a", "e" as any * 23, NaN, "s", 34].compact()) - .toEqual([1, 2, 3, "a", "s", 34]); + test('[0,1,false,2,"",3,"a","e" * 23,NaN,"s",34].compact() returns [1,2,3,"a","s",34]', () => { + expect( + [0, 1, false, 2, "", 3, "a", ("e" as any) * 23, NaN, "s", 34].compact(), + ).toEqual([1, 2, 3, "a", "s", 34]); }); }); diff --git a/src/array/contains/index.ts b/src/array/contains/index.ts index 2bcd126c..72de171e 100644 --- a/src/array/contains/index.ts +++ b/src/array/contains/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/contains/method.ts b/src/array/contains/method.ts index d31a9e53..0a7f6b47 100644 --- a/src/array/contains/method.ts +++ b/src/array/contains/method.ts @@ -1,3 +1,3 @@ -const method = (arr: T[], value: T) => arr.indexOf(value) !== -1; +const method = (arr: T[], value: T) => arr.includes(value); export = method; diff --git a/src/array/contains/test.ts b/src/array/contains/test.ts index eb1264c5..f4aff47b 100644 --- a/src/array/contains/test.ts +++ b/src/array/contains/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.contains", () => { test("[1, 2, 3].contains(2) returns true", () => { diff --git a/src/array/count/index.ts b/src/array/count/index.ts index 487556e7..99d0b553 100644 --- a/src/array/count/index.ts +++ b/src/array/count/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/count/method.ts b/src/array/count/method.ts index 2d7c5972..313e6195 100644 --- a/src/array/count/method.ts +++ b/src/array/count/method.ts @@ -1,5 +1,4 @@ -const method = (arr: T[], value: T) => value ? - arr.reduce((a, v) => a + Number(v === value), 0) : - arr.length; +const method = (arr: T[], value: T) => + value ? arr.reduce((a, v) => a + Number(v === value), 0) : arr.length; export = method; diff --git a/src/array/count/test.ts b/src/array/count/test.ts index 8607feb1..aa7a2256 100644 --- a/src/array/count/test.ts +++ b/src/array/count/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.count", () => { test("[1, 1, 2, 1, 2, 3].count() returns 6", () => { diff --git a/src/array/countBy/index.ts b/src/array/countBy/index.ts index bb8ff790..945b7ad5 100644 --- a/src/array/countBy/index.ts +++ b/src/array/countBy/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { @@ -8,7 +8,8 @@ declare global { } /** - * Groups the elements of an array based on the given function and returns the count of elements in each group + * Groups the elements of an array based on the given function and + * returns the count of elements in each group * @memberof Array.prototype * @function countBy * @param {String|Function} fn diff --git a/src/array/countBy/method.ts b/src/array/countBy/method.ts index 84ef1f8b..69f29935 100644 --- a/src/array/countBy/method.ts +++ b/src/array/countBy/method.ts @@ -1,9 +1,14 @@ -const method = (arr: T[], fn: string | ((value: T, index: number, arr: T[]) => any)) => - arr.map(typeof fn === "function" ? fn : (value) => (value as any)[fn]) +const method = ( + arr: T[], + fn: string | ((value: T, index: number, arr: T[]) => any), +) => + arr + .map(typeof fn === "function" ? fn : value => (value as any)[fn]) .reduce((prev: { [key: string]: any }, value: string) => { prev[value] = (prev[value] || 0) + 1; return prev; + // tslint:disable-next-line: align }, {}); export = method; diff --git a/src/array/countBy/test.ts b/src/array/countBy/test.ts index b675494a..14baed4d 100644 --- a/src/array/countBy/test.ts +++ b/src/array/countBy/test.ts @@ -1,11 +1,11 @@ -import "./index"; +import "."; describe("Array.prototype.countBy", () => { test("[6.1, 4.2, 6.3].countBy(Math.floor) returns {4: 1, 6: 2}", () => { - expect([6.1, 4.2, 6.3].countBy(Math.floor)).toEqual({4: 1, 6: 2}); + expect([6.1, 4.2, 6.3].countBy(Math.floor)).toEqual({ 4: 1, 6: 2 }); }); - test("[\"one\", \"two\", \"three\"].countBy(\"length\") returns {3: 2, 5: 1}", () => { - expect(["one", "two", "three"].countBy("length")).toEqual({3: 2, 5: 1}); + test('["one", "two", "three"].countBy("length") returns {3: 2, 5: 1}', () => { + expect(["one", "two", "three"].countBy("length")).toEqual({ 3: 2, 5: 1 }); }); }); diff --git a/src/array/crossJoin/index.ts b/src/array/crossJoin/index.ts index c7747869..1852e6e9 100644 --- a/src/array/crossJoin/index.ts +++ b/src/array/crossJoin/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { @@ -8,7 +8,8 @@ declare global { } /** - * Cross joins the array's values among the given arrays, returning a Cartesian product with all possible permutations + * Cross joins the array's values among the given arrays, + * returning a Cartesian product with all possible permutations * @memberof Array.prototype * @function crossJoin * @param {Array} array diff --git a/src/array/crossJoin/method.ts b/src/array/crossJoin/method.ts index 7ec60b5f..880470bf 100644 --- a/src/array/crossJoin/method.ts +++ b/src/array/crossJoin/method.ts @@ -1,10 +1,7 @@ const method = (arr: T[], arr2: P[]) => { const joined: Array<[T, P]> = []; - arr.forEach((item) => arr2.forEach((value) => joined.push([ - item, - value, - ]))); + arr.forEach(item => arr2.forEach(value => joined.push([item, value]))); return joined; }; diff --git a/src/array/crossJoin/test.ts b/src/array/crossJoin/test.ts index 690646a1..ebd6136e 100644 --- a/src/array/crossJoin/test.ts +++ b/src/array/crossJoin/test.ts @@ -1,7 +1,12 @@ -import "./index"; +import "."; describe("Array.prototype.crossJoin", () => { - test("[1, 2].crossJoin([\"a\", \"b\"]); returns [[1, \"a\"], [1, \"b\"], [2, \"a\"], [2, \"b\"]]", () => { - expect([1, 2].crossJoin(["a", "b"])).toEqual([[1, "a"], [1, "b"], [2, "a"], [2, "b"]]); + test('[1, 2].crossJoin(["a", "b"]); returns [[1, "a"], [1, "b"], [2, "a"], [2, "b"]]', () => { + expect([1, 2].crossJoin(["a", "b"])).toEqual([ + [1, "a"], + [1, "b"], + [2, "a"], + [2, "b"], + ]); }); }); diff --git a/src/array/deepFlatten/index.ts b/src/array/deepFlatten/index.ts index 111efb5c..edc25e64 100644 --- a/src/array/deepFlatten/index.ts +++ b/src/array/deepFlatten/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/deepFlatten/method.ts b/src/array/deepFlatten/method.ts index ddbf1007..365b2572 100644 --- a/src/array/deepFlatten/method.ts +++ b/src/array/deepFlatten/method.ts @@ -1,3 +1,4 @@ -const method = (arr: any[]): any[] => [].concat(...arr.map((v) => (Array.isArray(v) ? method(v) : v))); +const method = (arr: any[]): any[] => + [].concat(...arr.map(v => (Array.isArray(v) ? method(v) : v))); export = method; diff --git a/src/array/deepFlatten/test.ts b/src/array/deepFlatten/test.ts index 903957c2..d2d45a03 100644 --- a/src/array/deepFlatten/test.ts +++ b/src/array/deepFlatten/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.deepFlatten", () => { test("[1, [2], [[3], 4], 5].deepFlatten() returns [1,2,3,4,5]", () => { diff --git a/src/array/diff/index.ts b/src/array/diff/index.ts index 54d06b2d..e25d2b4d 100644 --- a/src/array/diff/index.ts +++ b/src/array/diff/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { @@ -9,7 +9,8 @@ declare global { /** * Returns the difference between this and another array - * if `comp` is given, filters out all values from an array for which the comparator function does not return true + * if `comp` is given, filters out all values from an array for which the comparator function + * does not return true * @memberof Array.prototype * @function diff * @param {Array} array diff --git a/src/array/diff/method.ts b/src/array/diff/method.ts index 1d0b5bb3..3f1921f3 100644 --- a/src/array/diff/method.ts +++ b/src/array/diff/method.ts @@ -1,5 +1,9 @@ -const method = (arr: T[], array: P[], comp?: (a: T, b: P) => boolean): any[] => { - if (comp) return arr.filter((a) => array.findIndex((b) => comp(a, b)) === -1); +const method = ( + arr: T[], + array: P[], + comp?: (a: T, b: P) => boolean, +): any[] => { + if (comp) return arr.filter(a => array.findIndex(b => comp(a, b)) === -1); const set = new Set(array); diff --git a/src/array/diff/test.ts b/src/array/diff/test.ts index d5266ab9..e304ec94 100644 --- a/src/array/diff/test.ts +++ b/src/array/diff/test.ts @@ -1,12 +1,17 @@ -import "./index"; +import "."; describe("Array.prototype.diff", () => { test("[1, 2, 3].diff([1, 2, 4]) returns [3]", () => { expect([1, 2, 3].diff([1, 2, 4])).toEqual([3]); }); + // tslint:disable-next-line: max-line-length test("[1, 1.2, 1.5, 3, 0].diff([1.9, 3, 0], (a, b) => Math.round(a) === Math.round(b)) returns [1, 1.2]", () => { - expect([1, 1.2, 1.5, 3, 0].diff([1.9, 3, 0], (a, b) => Math.round(a) === Math.round(b))) - .toEqual([1, 1.2]); + expect( + [1, 1.2, 1.5, 3, 0].diff( + [1.9, 3, 0], + (a, b) => Math.round(a) === Math.round(b), + ), + ).toEqual([1, 1.2]); }); }); diff --git a/src/array/distinct/index.ts b/src/array/distinct/index.ts index 26291371..077469c9 100644 --- a/src/array/distinct/index.ts +++ b/src/array/distinct/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/distinct/method.ts b/src/array/distinct/method.ts index 73d4948b..077626bc 100644 --- a/src/array/distinct/method.ts +++ b/src/array/distinct/method.ts @@ -1,13 +1,16 @@ -import * as isString from "../../string/isString/method"; +import isString from "../../string/isString/method"; import { pathToKeys } from "../../utils"; -const method = (arr: T[], fn?: string | ((value: T, index: number, array: T[]) => any)) => { +const method = ( + arr: T[], + fn?: string | ((value: T, index: number, array: T[]) => any), +) => { if (!fn) return [...new Set(arr)]; if (isString(fn)) { const keys = pathToKeys(fn); - fn = (value) => keys.reduce((prev: any, cur) => prev[cur], value); + fn = value => keys.reduce((prev: any, cur) => prev[cur], value); } const length = arr.length; diff --git a/src/array/distinct/test.ts b/src/array/distinct/test.ts index 9196a4dc..a1b4e214 100644 --- a/src/array/distinct/test.ts +++ b/src/array/distinct/test.ts @@ -1,16 +1,26 @@ -import "./index"; +import "."; describe("Array.prototype.distinct", () => { test("[1, 2, 2, 3, 4, 4, 5].distinct() returns [1,2,3,4,5]", () => { expect([1, 2, 2, 3, 4, 4, 5].distinct()).toEqual([1, 2, 3, 4, 5]); }); - test("[{foo:{bar:[0,1]}}, {foo:{bar:[4,1]}}].distinct(\"foo.bar[1]\") returns [{foo:{bar:[0,1]}}]", () => { - expect([{ foo: { bar: [0, 1] } }, { foo: { bar: [4, 1] } }].distinct("foo.bar[1]")) - .toEqual([{ foo: { bar: [0, 1] } }]); + // tslint:disable-next-line: max-line-length + test('[{foo:{bar:[0,1]}}, {foo:{bar:[4,1]}}].distinct("foo.bar[1]") returns [{foo:{bar:[0,1]}}]', () => { + expect( + [{ foo: { bar: [0, 1] } }, { foo: { bar: [4, 1] } }].distinct( + "foo.bar[1]", + ), + ).toEqual([{ foo: { bar: [0, 1] } }]); }); test("[1, 2, 2.2, 3, 4.9, 4, 5].distinct(Math.floor) returns [1,2,3,4.9,5]", () => { - expect([1, 2, 2.2, 3, 4.9, 4, 5].distinct(Math.floor)).toEqual([1, 2, 3, 4.9, 5]); + expect([1, 2, 2.2, 3, 4.9, 4, 5].distinct(Math.floor)).toEqual([ + 1, + 2, + 3, + 4.9, + 5, + ]); }); }); diff --git a/src/array/distinctBy/index.ts b/src/array/distinctBy/index.ts index cb976da8..b0927d09 100644 --- a/src/array/distinctBy/index.ts +++ b/src/array/distinctBy/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/distinctBy/method.ts b/src/array/distinctBy/method.ts index aaccbd73..24c083b7 100644 --- a/src/array/distinctBy/method.ts +++ b/src/array/distinctBy/method.ts @@ -1,7 +1,7 @@ const method = (arr: T[], fn: (a: T, b: T) => boolean) => { const distinct: T[] = []; - arr.forEach((a) => { + arr.forEach(a => { let had = false; for (let i = 0; i < distinct.length; i++) { diff --git a/src/array/distinctBy/test.ts b/src/array/distinctBy/test.ts index 6b61e862..d44059d8 100644 --- a/src/array/distinctBy/test.ts +++ b/src/array/distinctBy/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.distinctBy", () => { test("[1, 2, 2, 3, 4, 4, 5].distinctBy((a, b) => a === b) returns [1,2,3,4,5]", () => { diff --git a/src/array/empty/index.ts b/src/array/empty/index.ts index 6cdb1a19..151d7c50 100644 --- a/src/array/empty/index.ts +++ b/src/array/empty/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/empty/test.ts b/src/array/empty/test.ts index e7342853..77abe050 100644 --- a/src/array/empty/test.ts +++ b/src/array/empty/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.empty", () => { test("[1,2].empty()", () => { diff --git a/src/array/equals/index.ts b/src/array/equals/index.ts index 9adbee75..90aff37f 100644 --- a/src/array/equals/index.ts +++ b/src/array/equals/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/equals/method.ts b/src/array/equals/method.ts index e23d25eb..6a860477 100644 --- a/src/array/equals/method.ts +++ b/src/array/equals/method.ts @@ -1,12 +1,12 @@ -import * as range from "../range/method"; -import * as objectEquals from "../../object/equals/method"; +import objectEquals from "../../object/equals/method"; +import range from "../range/method"; const method = (arr: T[], value: any): boolean => { if (!Array.isArray(value)) return false; if (arr.length !== value.length) return false; - return range(arr.length - 1).every((key) => objectEquals(arr[key], value[key])); + return range(arr.length - 1).every(key => objectEquals(arr[key], value[key])); }; export = method; diff --git a/src/array/equals/test.ts b/src/array/equals/test.ts index 86d61872..c18e6f8d 100644 --- a/src/array/equals/test.ts +++ b/src/array/equals/test.ts @@ -1,12 +1,25 @@ -import "./index"; +import "."; describe("Array.prototype.equals", () => { - test("[1,2,{hello: [\"world\", true]}].equals([1,2,{hello: [\"world\", true]}]) returns true", () => { - expect([1, 2, { hello: ["world", true] }].equals([1, 2, { hello: ["world", true] }])).toBe(true); + test('[1,2,{hello: ["world", true]}].equals([1,2,{hello: ["world", true]}]) returns true', () => { + expect( + [1, 2, { hello: ["world", true] }].equals([ + 1, + 2, + { hello: ["world", true] }, + ]), + ).toBe(true); }); - test("[1,2,{hello: [\"world\", true]}].equals([1,2,{hello: [\"world\", null]}]) returns false", () => { - expect([1, 2, { hello: ["world", true] }].equals([1, 2, { hello: ["world", null] }])).toBe(false); + // tslint:disable-next-line: max-line-length + test('[1,2,{hello: ["world", true]}].equals([1,2,{hello: ["world", null]}]) returns false', () => { + expect( + [1, 2, { hello: ["world", true] }].equals([ + 1, + 2, + { hello: ["world", null] }, + ]), + ).toBe(false); }); test("[1,2,3].equals([2,1,3]) returns false", () => { diff --git a/src/array/everyNth/index.ts b/src/array/everyNth/index.ts index c8fe7db2..32e377c5 100644 --- a/src/array/everyNth/index.ts +++ b/src/array/everyNth/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/everyNth/method.ts b/src/array/everyNth/method.ts index e2da2272..8c640512 100644 --- a/src/array/everyNth/method.ts +++ b/src/array/everyNth/method.ts @@ -1,3 +1,4 @@ -const method = (arr: T[], nth: number) => arr.filter((e, i) => i % nth === nth - 1); +const method = (arr: T[], nth: number) => + arr.filter((e, i) => i % nth === nth - 1); export = method; diff --git a/src/array/everyNth/test.ts b/src/array/everyNth/test.ts index 516ff312..b9d8d4bc 100644 --- a/src/array/everyNth/test.ts +++ b/src/array/everyNth/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("Array.prototype.everyNth", () => { test("[1, 2, 3, 4, 5, 6].everyNth() returns [ 2, 4, 6 ]", () => { - expect([1, 2, 3, 4, 5, 6].everyNth(2)) - .toEqual([2, 4, 6]); + expect([1, 2, 3, 4, 5, 6].everyNth(2)).toEqual([2, 4, 6]); }); }); diff --git a/src/array/first/index.ts b/src/array/first/index.ts index fde98da4..a3a28d12 100644 --- a/src/array/first/index.ts +++ b/src/array/first/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/first/test.ts b/src/array/first/test.ts index d5a24fd6..db780105 100644 --- a/src/array/first/test.ts +++ b/src/array/first/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.first", () => { test("[1, 2, 3].first() returns 1", () => { diff --git a/src/array/flatten/index.ts b/src/array/flatten/index.ts index b82114c2..34881916 100644 --- a/src/array/flatten/index.ts +++ b/src/array/flatten/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/flatten/method.ts b/src/array/flatten/method.ts index 805d9ea9..d9fc2180 100644 --- a/src/array/flatten/method.ts +++ b/src/array/flatten/method.ts @@ -1,5 +1,10 @@ -const method = (arr: T[], depth: number = 1): any[] => depth !== 1 ? - arr.reduce((prev, value) => prev.concat(Array.isArray(value) ? method(value, depth - 1) : value), [] as any[]) : - arr.reduce((prev, value) => prev.concat(value), [] as any[]); +const method = (arr: T[], depth: number = 1): any[] => + depth !== 1 + ? arr.reduce( + (prev, value) => + prev.concat(Array.isArray(value) ? method(value, depth - 1) : value), + [] as any[], + ) + : arr.reduce((prev, value) => prev.concat(value), [] as any[]); export = method; diff --git a/src/array/flatten/test.ts b/src/array/flatten/test.ts index 242718e0..febeca28 100644 --- a/src/array/flatten/test.ts +++ b/src/array/flatten/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.flatten", () => { test("[1, [2], 3, 4].flatten() returns [1, 2, 3, 4]", () => { @@ -6,6 +6,14 @@ describe("Array.prototype.flatten", () => { }); test("[1, [2, [3, [4, 5], 6], 7], 8].flatten(2) returns [1, 2, 3, [4, 5], 6, 7, 8]", () => { - expect([1, [2, [3, [4, 5], 6], 7], 8].flatten(2)).toEqual([1, 2, 3, [4, 5], 6, 7, 8]); + expect([1, [2, [3, [4, 5], 6], 7], 8].flatten(2)).toEqual([ + 1, + 2, + 3, + [4, 5], + 6, + 7, + 8, + ]); }); }); diff --git a/src/array/get/index.ts b/src/array/get/index.ts index 3cdbaabc..4d8b4cb9 100644 --- a/src/array/get/index.ts +++ b/src/array/get/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/get/method.ts b/src/array/get/method.ts index a91c0b21..2f3a8759 100644 --- a/src/array/get/method.ts +++ b/src/array/get/method.ts @@ -1,5 +1,7 @@ -const method = (arr: T[], index: number, def: P = null as any) => (index >= arr.length) ? - def : - arr[index]; +const method = ( + arr: T[], + index: number, + def: P = null as any, +) => (index >= arr.length ? def : arr[index]); export = method; diff --git a/src/array/get/test.ts b/src/array/get/test.ts index 677f03e1..65dffb05 100644 --- a/src/array/get/test.ts +++ b/src/array/get/test.ts @@ -1,7 +1,7 @@ -import "./index"; +import "."; describe("Array.prototype.get", () => { - test("[1, 2, 3].get(0, \"default value\") returns 1", () => { + test('[1, 2, 3].get(0, "default value") returns 1', () => { expect([1, 2, 3].get(0, "default value")).toBe(1); }); diff --git a/src/array/groupBy/index.ts b/src/array/groupBy/index.ts index 28ce3d8d..fe9cf140 100644 --- a/src/array/groupBy/index.ts +++ b/src/array/groupBy/index.ts @@ -1,9 +1,11 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { - groupBy(fn: string | ((item: any, index: number, array: any[]) => any)): { [key: string]: T[] }; + groupBy( + fn: string | ((item: any, index: number, array: any[]) => any), + ): { [key: string]: T[] }; } } diff --git a/src/array/groupBy/method.ts b/src/array/groupBy/method.ts index 4a448bb9..35a9dcab 100644 --- a/src/array/groupBy/method.ts +++ b/src/array/groupBy/method.ts @@ -1,10 +1,14 @@ const method = ( - arr: T[], fn: string | ((item: T, index: number, array: T[]) => any)): { [key: string]: T[] } => { - return arr.map(typeof fn === "function" ? fn : (value) => (value as any)[fn]) + arr: T[], + fn: string | ((item: T, index: number, array: T[]) => any), +): { [key: string]: T[] } => { + return arr + .map(typeof fn === "function" ? fn : value => (value as any)[fn]) .reduce((prev, value, i) => { prev[value] = (prev[value] || []).concat(arr[i]); return prev; + // tslint:disable-next-line: align }, {}); }; diff --git a/src/array/groupBy/test.ts b/src/array/groupBy/test.ts index a5d9b116..4cb5e50f 100644 --- a/src/array/groupBy/test.ts +++ b/src/array/groupBy/test.ts @@ -1,13 +1,18 @@ -import "./index"; +import "."; describe("Array.prototype.groupBy", () => { test("[6.1, 4.2, 6.3].groupBy(Math.floor) returns {4: [4.2], 6: [6.1, 6.3]}", () => { - expect([6.1, 4.2, 6.3].groupBy(Math.floor)) - .toEqual({ 4: [4.2], 6: [6.1, 6.3] }); + expect([6.1, 4.2, 6.3].groupBy(Math.floor)).toEqual({ + 4: [4.2], + 6: [6.1, 6.3], + }); }); - test("[\"one\", \"two\", \"three\"].groupBy(\"length\") returns {3: [\"one\", \"two\"], 5: [\"three\"]}", () => { - expect(["one", "two", "three"].groupBy("length")) - .toEqual({ 3: ["one", "two"], 5: ["three"] }); + // tslint:disable-next-line: max-line-length + test('["one", "two", "three"].groupBy("length") returns {3: ["one", "two"], 5: ["three"]}', () => { + expect(["one", "two", "three"].groupBy("length")).toEqual({ + 3: ["one", "two"], + 5: ["three"], + }); }); }); diff --git a/src/array/implode/index.ts b/src/array/implode/index.ts index 5cf52a49..c94ec04b 100644 --- a/src/array/implode/index.ts +++ b/src/array/implode/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { @@ -15,6 +15,7 @@ declare global { * @param {String} [separator=", "] * @returns {String} * @example - * [{a: {b: 'first'}}, {a: {b: 'second'}}, {a: {b: 'third'}}].implode('a.b', ', '); // 'first, second, third' + * [{a: {b: 'first'}}, {a: {b: 'second'}}, {a: {b: 'third'}}].implode('a.b', ', '); + * // 'first, second, third' */ addPrototype(Array, "implode", method); diff --git a/src/array/implode/method.ts b/src/array/implode/method.ts index 313a6f2c..146d68af 100644 --- a/src/array/implode/method.ts +++ b/src/array/implode/method.ts @@ -4,7 +4,12 @@ const method = (arr: T[], path: string, separator = ", "): string => { const keys = pathToKeys(path); return arr - .map((item) => keys.reduce((prev, cur) => (prev && (prev as any)[cur]) || undefined, item)) + .map(item => + keys.reduce( + (prev, cur) => (prev && (prev as any)[cur]) || undefined, + item, + ), + ) .filter(Boolean) .join(separator); }; diff --git a/src/array/implode/test.ts b/src/array/implode/test.ts index c515e98a..569ea8d9 100644 --- a/src/array/implode/test.ts +++ b/src/array/implode/test.ts @@ -1,19 +1,31 @@ -import "./index"; +import "."; describe("Array.prototype.implode", () => { test( - "[{a: {b: \"first\"}}, {a: {b: \"second\"}}, {a: {b: \"third\"}}].implode(\"a.b\", \", \")" + - " returns \"first, second, third\"", + '[{a: {b: "first"}}, {a: {b: "second"}}, {a: {b: "third"}}].implode("a.b", ", ")' + + ' returns "first, second, third"', () => { - expect([{ a: { b: "first" } }, { a: { b: "second" } }, { a: { b: "third" } }].implode("a.b", ", ")) - .toBe("first, second, third"); - }); + expect( + [ + { a: { b: "first" } }, + { a: { b: "second" } }, + { a: { b: "third" } }, + ].implode("a.b", ", "), + ).toBe("first, second, third"); + }, + ); test( - "[{a: {b: \"first\"}}, {a: {b: \"second\"}}, {a: {b: \"third\"}}].implode(\"a.c\")" + - " returns \"\"", + '[{a: {b: "first"}}, {a: {b: "second"}}, {a: {b: "third"}}].implode("a.c")' + + ' returns ""', () => { - expect([{ a: { b: "first" } }, { a: { b: "second" } }, { a: { b: "third" } }].implode("a.c")) - .toBe(""); - }); + expect( + [ + { a: { b: "first" } }, + { a: { b: "second" } }, + { a: { b: "third" } }, + ].implode("a.c"), + ).toBe(""); + }, + ); }); diff --git a/src/array/indexOfAll/index.ts b/src/array/indexOfAll/index.ts index c54705fb..64fc97bf 100644 --- a/src/array/indexOfAll/index.ts +++ b/src/array/indexOfAll/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/indexOfAll/test.ts b/src/array/indexOfAll/test.ts index 7f358d2f..01e0ba10 100644 --- a/src/array/indexOfAll/test.ts +++ b/src/array/indexOfAll/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.indexOfAll", () => { test("[1, 2, 3, 1, 2, 3].indexOfAll(1) returns [0,3]", () => { diff --git a/src/array/initial/index.ts b/src/array/initial/index.ts index aa45dc0a..e0f412a1 100644 --- a/src/array/initial/index.ts +++ b/src/array/initial/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/initial/test.ts b/src/array/initial/test.ts index e54cbd49..5e10ac64 100644 --- a/src/array/initial/test.ts +++ b/src/array/initial/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.initial", () => { test("[1, 2, 3].initial() returns [1, 2]", () => { diff --git a/src/array/intersect/index.ts b/src/array/intersect/index.ts index d640258b..3cac9fca 100644 --- a/src/array/intersect/index.ts +++ b/src/array/intersect/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/intersect/method.ts b/src/array/intersect/method.ts index 458bf5b7..f5706ab1 100644 --- a/src/array/intersect/method.ts +++ b/src/array/intersect/method.ts @@ -1,7 +1,7 @@ const method = (arr: T[], array: any[]): T[] => { const set = new Set(array); - return arr.filter((item) => set.has(item)); + return arr.filter(item => set.has(item)); }; export = method; diff --git a/src/array/intersect/test.ts b/src/array/intersect/test.ts index dae0894c..db45e6e6 100644 --- a/src/array/intersect/test.ts +++ b/src/array/intersect/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.intersect", () => { test("[1, 2, 3].intersect([4, 3, 2]) returns [2,3]", () => { diff --git a/src/array/isEmpty/index.ts b/src/array/isEmpty/index.ts index 451b1798..93b7192a 100644 --- a/src/array/isEmpty/index.ts +++ b/src/array/isEmpty/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/isEmpty/test.ts b/src/array/isEmpty/test.ts index efe5110c..4508de52 100644 --- a/src/array/isEmpty/test.ts +++ b/src/array/isEmpty/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.isEmpty", () => { test("[1,2].isEmpty() returns false", () => { diff --git a/src/array/last/index.ts b/src/array/last/index.ts index b13e35cf..da1872a8 100644 --- a/src/array/last/index.ts +++ b/src/array/last/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/last/test.ts b/src/array/last/test.ts index 2369b0a9..22e069bc 100644 --- a/src/array/last/test.ts +++ b/src/array/last/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.last", () => { test("[1, 2, 3].last() returns 3", () => { diff --git a/src/array/limit/index.ts b/src/array/limit/index.ts index 26787a7d..c1450336 100644 --- a/src/array/limit/index.ts +++ b/src/array/limit/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/limit/test.ts b/src/array/limit/test.ts index 31669a3f..2d355a50 100644 --- a/src/array/limit/test.ts +++ b/src/array/limit/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.limit", () => { test("[2, 1, 2, 5].limit(2) returns [2,1]", () => { diff --git a/src/array/max/index.ts b/src/array/max/index.ts index 1df0726e..687e75af 100644 --- a/src/array/max/index.ts +++ b/src/array/max/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/max/method.ts b/src/array/max/method.ts index 081faaa7..f7f7b094 100644 --- a/src/array/max/method.ts +++ b/src/array/max/method.ts @@ -6,7 +6,11 @@ const method = (arr: T[], path?: string) => { if (path) { const keys = pathToKeys(path); - reducer = (item: T) => keys.reduce((prev, curr) => (prev && (prev as any)[curr]) || -Infinity, item); + reducer = (item: T) => + keys.reduce( + (prev, curr) => (prev && (prev as any)[curr]) || -Infinity, + item, + ); } return arr.reduce((prev, cur) => Math.max(prev, reducer(cur)), -Infinity); diff --git a/src/array/max/test.ts b/src/array/max/test.ts index d6689067..da218810 100644 --- a/src/array/max/test.ts +++ b/src/array/max/test.ts @@ -1,19 +1,21 @@ -import "./index"; +import "."; describe("Array.prototype.max", () => { test("[1, 2, 3].max() returns 3", () => { expect([1, 2, 3].max()).toBe(3); }); - test("[{a: 1}, {a: 2}, {a: 3}].max(\"a\") returns 3", () => { + test('[{a: 1}, {a: 2}, {a: 3}].max("a") returns 3', () => { expect([{ a: 1 }, { a: 2 }, { a: 3 }].max("a")).toBe(3); }); - test("[{a: 1}, {a: 2}, {a: 3}].max(\"b\") returns -Infinity", () => { + test('[{a: 1}, {a: 2}, {a: 3}].max("b") returns -Infinity', () => { expect([{ a: 1 }, { a: 2 }, { a: 3 }].max("b")).toBe(-Infinity); }); - test("[{a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}].max(\"a.b\") returns 3", () => { - expect([{ a: { b: 1 } }, { a: { b: 2 } }, { a: { b: 3 } }].max("a.b")).toBe(3); + test('[{a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}].max("a.b") returns 3', () => { + expect([{ a: { b: 1 } }, { a: { b: 2 } }, { a: { b: 3 } }].max("a.b")).toBe( + 3, + ); }); }); diff --git a/src/array/median/index.ts b/src/array/median/index.ts index b31c500d..22659984 100644 --- a/src/array/median/index.ts +++ b/src/array/median/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/median/method.ts b/src/array/median/method.ts index b3882217..0aad109f 100644 --- a/src/array/median/method.ts +++ b/src/array/median/method.ts @@ -9,7 +9,8 @@ const method = (arr: T[], path?: string): number => { if (path) { const keys = pathToKeys(path); - reducer = (item: T) => keys.reduce((prev, curr) => (prev && (prev as any)[curr]) || prev, item); + reducer = (item: T) => + keys.reduce((prev, curr) => (prev && (prev as any)[curr]) || prev, item); } if (items.length % 2) return reducer(items[half]); diff --git a/src/array/median/test.ts b/src/array/median/test.ts index 951e8c57..22afc75d 100644 --- a/src/array/median/test.ts +++ b/src/array/median/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.median", () => { test("[1, 1, 2, 4].median() returns 1.5", () => { @@ -9,15 +9,19 @@ describe("Array.prototype.median", () => { expect([1, 1, 2].median()).toBe(1); }); - test("[{foo: 10}, {foo: 10}, {foo: 20}, {foo: 40}].median(\"foo\") returns 15", () => { - expect([{ foo: 10 }, { foo: 10 }, { foo: 20 }, { foo: 40 }].median("foo")).toBe(15); + test('[{foo: 10}, {foo: 10}, {foo: 20}, {foo: 40}].median("foo") returns 15', () => { + expect( + [{ foo: 10 }, { foo: 10 }, { foo: 20 }, { foo: 40 }].median("foo"), + ).toBe(15); }); - test("[{foo: 10}, {foo: 10}, {foo: 20}, {foo: 40}].median(\"bar\") returns NaN", () => { - expect([{ foo: 10 }, { foo: 10 }, { foo: 20 }, { foo: 40 }].median("bar")).toBe(NaN); + test('[{foo: 10}, {foo: 10}, {foo: 20}, {foo: 40}].median("bar") returns NaN', () => { + expect( + [{ foo: 10 }, { foo: 10 }, { foo: 20 }, { foo: 40 }].median("bar"), + ).toBe(NaN); }); - test("[{foo: 10}, {foo: 10}, {foo: 20}].median(\"foo\") returns 10", () => { + test('[{foo: 10}, {foo: 10}, {foo: 20}].median("foo") returns 10', () => { expect([{ foo: 10 }, { foo: 10 }, { foo: 20 }].median("foo")).toBe(10); }); }); diff --git a/src/array/merge/index.ts b/src/array/merge/index.ts index f2e4727a..4022afa2 100644 --- a/src/array/merge/index.ts +++ b/src/array/merge/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/merge/method.ts b/src/array/merge/method.ts index 097167e6..6a23dfd0 100644 --- a/src/array/merge/method.ts +++ b/src/array/merge/method.ts @@ -1,4 +1,4 @@ -const method = (arr: T[], arr2: any[]): void => { +const method = (arr: T[], arr2: any[]): void => { arr.push(...arr2); }; diff --git a/src/array/merge/test.ts b/src/array/merge/test.ts index 7a0833d3..f214a399 100644 --- a/src/array/merge/test.ts +++ b/src/array/merge/test.ts @@ -1,6 +1,7 @@ -import "./index"; +import "."; describe("Array.prototype.merge", () => { + // tslint:disable-next-line: max-line-length test("myArray = [1, 2, 3] & myArray.merge([0, 6 , 2]) results myArray to be [1, 2, 3, 0, 6, 2]", () => { const myArray = [1, 2, 3]; diff --git a/src/array/methods.ts b/src/array/methods.ts index ea24001d..660ba146 100644 --- a/src/array/methods.ts +++ b/src/array/methods.ts @@ -1,65 +1,65 @@ -import * as all from "./all/method"; -import * as any from "./any/method"; -import * as append from "./append/method"; -import * as average from "./average/method"; -import * as chunk from "./chunk/method"; -import * as clone from "./clone/method"; -import * as compact from "./compact/method"; -import * as contains from "./contains/method"; -import * as count from "./count/method"; -import * as countBy from "./countBy/method"; -import * as crossJoin from "./crossJoin/method"; -import * as deepFlatten from "./deepFlatten/method"; -import * as diff from "./diff/method"; -import * as distinct from "./distinct/method"; -import * as distinctBy from "./distinctBy/method"; -import * as empty from "./empty/method"; -import * as equals from "./equals/method"; -import * as everyNth from "./everyNth/method"; -import * as first from "./first/method"; -import * as flatten from "./flatten/method"; -import * as get from "./get/method"; -import * as groupBy from "./groupBy/method"; -import * as implode from "./implode/method"; -import * as indexOfAll from "./indexOfAll/method"; -import * as initial from "./initial/method"; -import * as intersect from "./intersect/method"; -import * as isEmpty from "./isEmpty/method"; -import * as last from "./last/method"; -import * as limit from "./limit/method"; -import * as max from "./max/method"; -import * as median from "./median/method"; -import * as merge from "./merge/method"; -import * as min from "./min/method"; -import * as nest from "./nest/method"; -import * as orderBy from "./orderBy/method"; -import * as pad from "./pad/method"; -import * as partition from "./partition/method"; -import * as pluck from "./pluck/method"; -import * as prepend from "./prepend/method"; -import * as pull from "./pull/method"; -import * as range from "./range/method"; -import * as repeat from "./repeat/method"; -import * as sample from "./sample/method"; -import * as shuffle from "./shuffle/method"; -import * as skip from "./skip/method"; -import * as sortBy from "./sortBy/method"; -import * as sum from "./sum/method"; -import * as tail from "./tail/method"; -import * as toCSV from "./toCSV/method"; -import * as union from "./union/method"; -import * as unwind from "./unwind/method"; -import * as where from "./where/method"; -import * as whereBetween from "./whereBetween/method"; -import * as whereIn from "./whereIn/method"; -import * as whereLike from "./whereLike/method"; -import * as whereNotBetween from "./whereNotBetween/method"; -import * as whereNotIn from "./whereNotIn/method"; -import * as whereNotLike from "./whereNotLike/method"; -import * as whereNotNull from "./whereNotNull/method"; -import * as whereNull from "./whereNull/method"; -import * as zip from "./zip/method"; -import * as zipObject from "./zipObject/method"; +import all from "./all/method"; +import any from "./any/method"; +import append from "./append/method"; +import average from "./average/method"; +import chunk from "./chunk/method"; +import clone from "./clone/method"; +import compact from "./compact/method"; +import contains from "./contains/method"; +import count from "./count/method"; +import countBy from "./countBy/method"; +import crossJoin from "./crossJoin/method"; +import deepFlatten from "./deepFlatten/method"; +import diff from "./diff/method"; +import distinct from "./distinct/method"; +import distinctBy from "./distinctBy/method"; +import empty from "./empty/method"; +import equals from "./equals/method"; +import everyNth from "./everyNth/method"; +import first from "./first/method"; +import flatten from "./flatten/method"; +import get from "./get/method"; +import groupBy from "./groupBy/method"; +import implode from "./implode/method"; +import indexOfAll from "./indexOfAll/method"; +import initial from "./initial/method"; +import intersect from "./intersect/method"; +import isEmpty from "./isEmpty/method"; +import last from "./last/method"; +import limit from "./limit/method"; +import max from "./max/method"; +import median from "./median/method"; +import merge from "./merge/method"; +import min from "./min/method"; +import nest from "./nest/method"; +import orderBy from "./orderBy/method"; +import pad from "./pad/method"; +import partition from "./partition/method"; +import pluck from "./pluck/method"; +import prepend from "./prepend/method"; +import pull from "./pull/method"; +import range from "./range/method"; +import repeat from "./repeat/method"; +import sample from "./sample/method"; +import shuffle from "./shuffle/method"; +import skip from "./skip/method"; +import sortBy from "./sortBy/method"; +import sum from "./sum/method"; +import tail from "./tail/method"; +import toCSV from "./toCSV/method"; +import union from "./union/method"; +import unwind from "./unwind/method"; +import where from "./where/method"; +import whereBetween from "./whereBetween/method"; +import whereIn from "./whereIn/method"; +import whereLike from "./whereLike/method"; +import whereNotBetween from "./whereNotBetween/method"; +import whereNotIn from "./whereNotIn/method"; +import whereNotLike from "./whereNotLike/method"; +import whereNotNull from "./whereNotNull/method"; +import whereNull from "./whereNull/method"; +import zip from "./zip/method"; +import zipObject from "./zipObject/method"; export { all, diff --git a/src/array/min/index.ts b/src/array/min/index.ts index 2c41f9c7..fe445445 100644 --- a/src/array/min/index.ts +++ b/src/array/min/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/min/method.ts b/src/array/min/method.ts index d53c2a6e..f74b41ab 100644 --- a/src/array/min/method.ts +++ b/src/array/min/method.ts @@ -6,7 +6,11 @@ const method = (arr: T[], path?: string): number => { if (path) { const keys = pathToKeys(path); - reducer = (item: T) => keys.reduce((prev, curr) => (prev && (prev as any)[curr]) || +Infinity, item); + reducer = (item: T) => + keys.reduce( + (prev, curr) => (prev && (prev as any)[curr]) || +Infinity, + item, + ); } return arr.reduce((prev, cur) => Math.min(prev, reducer(cur)), +Infinity); diff --git a/src/array/min/test.ts b/src/array/min/test.ts index 9e78211d..65df12a5 100644 --- a/src/array/min/test.ts +++ b/src/array/min/test.ts @@ -1,19 +1,21 @@ -import "./index"; +import "."; describe("Array.prototype.min", () => { test("[1, 2, 3].min() returns 1", () => { expect([1, 2, 3].min()).toBe(1); }); - test("[{a: 1}, {a: 2}, {a: 3}].min(\"a\") returns 1", () => { + test('[{a: 1}, {a: 2}, {a: 3}].min("a") returns 1', () => { expect([{ a: 1 }, { a: 2 }, { a: 3 }].min("a")).toBe(1); }); - test("[{a: 1}, {a: 2}, {a: 3}].min(\"b\") returns +Infinity", () => { + test('[{a: 1}, {a: 2}, {a: 3}].min("b") returns +Infinity', () => { expect([{ a: 1 }, { a: 2 }, { a: 3 }].min("b")).toBe(+Infinity); }); - test("[{a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}].min(\"a.b\") returns 1", () => { - expect([{ a: { b: 1 } }, { a: { b: 2 } }, { a: { b: 3 } }].min("a.b")).toBe(1); + test('[{a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}].min("a.b") returns 1', () => { + expect([{ a: { b: 1 } }, { a: { b: 2 } }, { a: { b: 3 } }].min("a.b")).toBe( + 1, + ); }); }); diff --git a/src/array/nest/index.ts b/src/array/nest/index.ts index dce1dfcb..fc25ca30 100644 --- a/src/array/nest/index.ts +++ b/src/array/nest/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/nest/method.ts b/src/array/nest/method.ts index ea6bd628..f8312bdb 100644 --- a/src/array/nest/method.ts +++ b/src/array/nest/method.ts @@ -1,7 +1,12 @@ const filter = (arr: any[], link: string, key: string, id: any = null): any[] => - arr.filter((item) => item[link] === id) - .map((item) => ({ ...item, children: filter(arr, link, key, item[key]) })); + arr + .filter(item => item[link] === id) + .map(item => ({ ...item, children: filter(arr, link, key, item[key]) })); -const method = (arr: T[], link: string = "parent_id", key: string = "id") => filter(arr, link, key); +const method = ( + arr: T[], + link: string = "parent_id", + key: string = "id", +) => filter(arr, link, key); export = method; diff --git a/src/array/nest/test.ts b/src/array/nest/test.ts index 548a7688..c220bb58 100644 --- a/src/array/nest/test.ts +++ b/src/array/nest/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.nest", () => { test("Array.prototype.nest (1)", () => { diff --git a/src/array/orderBy/index.ts b/src/array/orderBy/index.ts index c5704ced..aa934226 100644 --- a/src/array/orderBy/index.ts +++ b/src/array/orderBy/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/orderBy/method.ts b/src/array/orderBy/method.ts index deb5874b..8dacd57c 100644 --- a/src/array/orderBy/method.ts +++ b/src/array/orderBy/method.ts @@ -1,25 +1,29 @@ -import * as contains from "../contains/method"; import { pathToKeys } from "../../utils"; +import contains from "../contains/method"; -const method = (arr: T[], field?: string, order: "asc" | "desc" = "asc") => { - if (field && contains(["asc", "desc"], field)) { - order = field as ("asc" | "desc"); - field = undefined; - } +const method = ( + arr: T[], + field?: string, + order: "asc" | "desc" = "asc", +) => { + if (field && contains(["asc", "desc"], field)) { + order = field as ("asc" | "desc"); + field = undefined; + } - const iterator: (a: any, b: any) => number = - order === "asc" ? - ((a, b) => (a > b ? 1 : (a < b ? -1 : 0))) : - ((a, b) => (a < b ? 1 : (a > b ? -1 : 0))); + const iterator: (a: any, b: any) => number = + order === "asc" + ? (a, b) => (a > b ? 1 : a < b ? -1 : 0) + : (a, b) => (a < b ? 1 : a > b ? -1 : 0); - if (field) { - const keys = pathToKeys(field as string); - const reducer = (item: any) => keys.reduce((prev, cur) => prev[cur], item); + if (field) { + const keys = pathToKeys(field as string); + const reducer = (item: any) => keys.reduce((prev, cur) => prev[cur], item); - return arr.sort((a, b) => iterator(reducer(a), reducer(b))); - } + return arr.sort((a, b) => iterator(reducer(a), reducer(b))); + } - return arr.sort(iterator); + return arr.sort(iterator); }; export = method; diff --git a/src/array/orderBy/test.ts b/src/array/orderBy/test.ts index cc9ad3ac..f77cef63 100644 --- a/src/array/orderBy/test.ts +++ b/src/array/orderBy/test.ts @@ -1,16 +1,18 @@ -import "./index"; +import "."; describe("Array.prototype.orderBy", () => { test("[2, 1, 2, 5].orderBy() returns [1,2,2,5]", () => { expect([2, 1, 2, 5].orderBy()).toEqual([1, 2, 2, 5]); }); - test("[2, 1, 2, 5].orderBy(\"desc\") returns [5,2,2,1]", () => { + test('[2, 1, 2, 5].orderBy("desc") returns [5,2,2,1]', () => { expect([2, 1, 2, 5].orderBy("desc")).toEqual([5, 2, 2, 1]); }); - test("[{count:1},{count:20},{count:15}].orderBy(\"count\",\"asc\") returns [{count:1},{count:15},{count:20}]", () => { - expect([{ count: 1 }, { count: 20 }, { count: 15 }].orderBy("count", "asc")) - .toEqual([{ count: 1 }, { count: 15 }, { count: 20 }]); + // tslint:disable-next-line: max-line-length + test('[{count:1},{count:20},{count:15}].orderBy("count","asc") returns [{count:1},{count:15},{count:20}]', () => { + expect( + [{ count: 1 }, { count: 20 }, { count: 15 }].orderBy("count", "asc"), + ).toEqual([{ count: 1 }, { count: 15 }, { count: 20 }]); }); }); diff --git a/src/array/pad/index.ts b/src/array/pad/index.ts index 0f761f8a..2e58b69e 100644 --- a/src/array/pad/index.ts +++ b/src/array/pad/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/pad/test.ts b/src/array/pad/test.ts index 24419c9c..20dbf83e 100644 --- a/src/array/pad/test.ts +++ b/src/array/pad/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.pad", () => { test("[1, 2, 3].pad(2) returns [1, 2, 3]", () => { diff --git a/src/array/partition/index.ts b/src/array/partition/index.ts index 9d6640a8..7b3dfbf0 100644 --- a/src/array/partition/index.ts +++ b/src/array/partition/index.ts @@ -1,20 +1,23 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { - partition(fn: (value: T, index: number, array: any[]) => boolean): [T[], any[]]; + partition(fn: (value: T, index: number, array: T[]) => boolean): [T[], T[]]; } } /** - * Groups the elements into two arrays, depending on the provided function's truthiness for each element + * Groups the elements into two arrays, + * depending on the provided function's truthiness for each element * @memberof Array.prototype * @function partition * @param {Function} fn * @returns {Array} * @example - * const users = [{ user: 'barney', age: 36, active: false }, { user: 'fred', age: 40, active: true }]; + * const users = [ + * { user: 'barney', age: 36, active: false }, { user: 'fred', age: 40, active: true } + * ]; * users.partition(o => o.active); // [ * [{ 'user': 'fred', 'age': 40, 'active': true }], * [{ 'user': 'barney', 'age': 36, 'active': false }] diff --git a/src/array/partition/method.ts b/src/array/partition/method.ts index b5e4cbf4..28f91a85 100644 --- a/src/array/partition/method.ts +++ b/src/array/partition/method.ts @@ -1,11 +1,14 @@ -const method = (arr: T[], fn: (value: T, index: number, array: T[]) => boolean): [T[], T[]] => { +const method = ( + arr: T[], + fn: (value: T, index: number, array: T[]) => boolean, +): [T[], T[]] => { return arr.reduce( (prev: any, value, index, array) => { prev[fn(value, index, array) ? 0 : 1].push(value); return prev; }, - [[] as T[], [] as T[]] + [[] as T[], [] as T[]], ); }; diff --git a/src/array/partition/test.ts b/src/array/partition/test.ts index 6deaa133..788ba62e 100644 --- a/src/array/partition/test.ts +++ b/src/array/partition/test.ts @@ -1,10 +1,16 @@ -import "./index"; +import "."; describe("Array.prototype.partition", () => { - test( - "[{ user: \"barney\", active: false }, { user: \"fred\", active: true }].partition(o => o.active) returns " + - "[[{ user: \"fred\", active: true }],[{ user: \"barney\", active: false }]]", () => { - expect([{ user: "barney", active: false }, { user: "fred", active: true }].partition((o) => o.active)) - .toEqual([[{ user: "fred", active: true }], [{ user: "barney", active: false }]]); - }); + test(// tslint:disable-next-line: max-line-length + '[{ user: "barney", active: false }, { user: "fred", active: true }].partition(o => o.active) returns [[{ user: "fred", active: true }],[{ user: "barney", active: false }]]', () => { + expect( + [ + { user: "barney", active: false }, + { user: "fred", active: true }, + ].partition(o => o.active), + ).toEqual([ + [{ user: "fred", active: true }], + [{ user: "barney", active: false }], + ]); + }); }); diff --git a/src/array/pluck/index.ts b/src/array/pluck/index.ts index edfff94b..c0b682b4 100644 --- a/src/array/pluck/index.ts +++ b/src/array/pluck/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/pluck/method.ts b/src/array/pluck/method.ts index 4932bad9..e85c5a3e 100644 --- a/src/array/pluck/method.ts +++ b/src/array/pluck/method.ts @@ -3,7 +3,9 @@ import { pathToKeys } from "../../utils"; const method = (arr: T[], path: string) => { const keys = pathToKeys(path); - return arr.map((item) => keys.reduce((prev, cur) => (prev && (prev as any)[cur]) || undefined, item)); + return arr.map(item => + keys.reduce((prev, cur) => (prev && (prev as any)[cur]) || undefined, item), + ); }; export = method; diff --git a/src/array/pluck/test.ts b/src/array/pluck/test.ts index 0740afdf..f770c1f0 100644 --- a/src/array/pluck/test.ts +++ b/src/array/pluck/test.ts @@ -1,18 +1,23 @@ -import "./index"; +import "."; describe("Array.prototype.pluck", () => { - test("[{a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}].pluck(\"a\") returns [{b: 1}, {b: 2}, {b: 3}]", () => { - expect([{ a: { b: 1 } }, { a: { b: 2 } }, { a: { b: 3 } }].pluck("a")) - .toEqual([{ b: 1 }, { b: 2 }, { b: 3 }]); + // tslint:disable-next-line: max-line-length + test('[{a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}].pluck("a") returns [{b: 1}, {b: 2}, {b: 3}]', () => { + expect( + [{ a: { b: 1 } }, { a: { b: 2 } }, { a: { b: 3 } }].pluck("a"), + ).toEqual([{ b: 1 }, { b: 2 }, { b: 3 }]); }); - test("[{a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}].pluck(\"a.b\") returns [1, 2, 3]", () => { - expect([{ a: { b: 1 } }, { a: { b: 2 } }, { a: { b: 3 } }].pluck("a.b")) - .toEqual([1, 2, 3]); + test('[{a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}].pluck("a.b") returns [1, 2, 3]', () => { + expect( + [{ a: { b: 1 } }, { a: { b: 2 } }, { a: { b: 3 } }].pluck("a.b"), + ).toEqual([1, 2, 3]); }); - test("[{a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}].pluck(\"a.c\") returns [undefined, undefined, undefined]", () => { - expect([{ a: { b: 1 } }, { a: { b: 2 } }, { a: { b: 3 } }].pluck("a.c")) - .toEqual([undefined, undefined, undefined]); + // tslint:disable-next-line: max-line-length + test('[{a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}].pluck("a.c") returns [undefined, undefined, undefined]', () => { + expect( + [{ a: { b: 1 } }, { a: { b: 2 } }, { a: { b: 3 } }].pluck("a.c"), + ).toEqual([undefined, undefined, undefined]); }); }); diff --git a/src/array/prepend/index.ts b/src/array/prepend/index.ts index 902fd970..051d5ff8 100644 --- a/src/array/prepend/index.ts +++ b/src/array/prepend/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/prepend/method.ts b/src/array/prepend/method.ts index 145dc541..628480ed 100644 --- a/src/array/prepend/method.ts +++ b/src/array/prepend/method.ts @@ -1,4 +1,4 @@ -const method = (arr: T[], value: any): void => { +const method = (arr: T[], value: any): void => { const array = [...arr]; arr.length = 0; diff --git a/src/array/prepend/test.ts b/src/array/prepend/test.ts index c6fe8942..e24d99a2 100644 --- a/src/array/prepend/test.ts +++ b/src/array/prepend/test.ts @@ -1,13 +1,15 @@ -import "./index"; +import "."; describe("Array.prototype.prepend", () => { test("myArray = [1, 2, 3] & myArray.prepend(0) results myArray to be [0, 1, 2, 3]", () => { - expect((() => { - const myArray = [1, 2, 3]; + expect( + (() => { + const myArray = [1, 2, 3]; - myArray.prepend(0); + myArray.prepend(0); - return myArray; - })()).toEqual([0, 1, 2, 3]); + return myArray; + })(), + ).toEqual([0, 1, 2, 3]); }); }); diff --git a/src/array/pull/index.ts b/src/array/pull/index.ts index 96075dea..75ffdd1c 100644 --- a/src/array/pull/index.ts +++ b/src/array/pull/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/pull/method.ts b/src/array/pull/method.ts index 50118134..75a68c6f 100644 --- a/src/array/pull/method.ts +++ b/src/array/pull/method.ts @@ -1,9 +1,9 @@ const method = (arr: T[], ...args: T[]): void => { - const pulled = arr.filter((value) => !(args as any).includes(value)); + const pulled = arr.filter(value => !(args as any).includes(value)); arr.length = 0; - pulled.forEach((value) => arr.push(value)); + pulled.forEach(value => arr.push(value)); }; export = method; diff --git a/src/array/pull/test.ts b/src/array/pull/test.ts index 6e65beb3..76b0fdab 100644 --- a/src/array/pull/test.ts +++ b/src/array/pull/test.ts @@ -1,14 +1,15 @@ -import "./index"; +import "."; describe("Array.prototype.pull", () => { test( - "myArray = [\"a\", \"b\", \"c\", \"a\", \"b\", \"c\"] & myArray.pull(\"a\", \"c\") results " + - "myArray to be [ \"b\", \"b\" ]", + 'myArray = ["a", "b", "c", "a", "b", "c"] & myArray.pull("a", "c") results ' + + 'myArray to be [ "b", "b" ]', () => { const myArray = ["a", "b", "c", "a", "b", "c"]; myArray.pull("a", "c"); expect(myArray).toEqual(["b", "b"]); - }); + }, + ); }); diff --git a/src/array/range/index.ts b/src/array/range/index.ts index 05831368..99cf5b50 100644 --- a/src/array/range/index.ts +++ b/src/array/range/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface ArrayConstructor { diff --git a/src/array/range/method.ts b/src/array/range/method.ts index 067356ad..1ad36413 100644 --- a/src/array/range/method.ts +++ b/src/array/range/method.ts @@ -1,5 +1,6 @@ -const method = (end: number, start: number = 0, step: number = 1): number[] => Array.from({ - length: Math.ceil((end + 1 - start) / step), -}).map((value, index) => index * step + start); +const method = (end: number, start: number = 0, step: number = 1): number[] => + Array.from({ + length: Math.ceil((end + 1 - start) / step), + }).map((value, index) => index * step + start); export = method; diff --git a/src/array/range/test.ts b/src/array/range/test.ts index 1c2e5cda..b2ea5bd5 100644 --- a/src/array/range/test.ts +++ b/src/array/range/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.range", () => { test("Array.range(5) returns [0,1,2,3,4,5]", () => { diff --git a/src/array/repeat/index.ts b/src/array/repeat/index.ts index 0cb7950e..e18b3dd2 100644 --- a/src/array/repeat/index.ts +++ b/src/array/repeat/index.ts @@ -1,8 +1,8 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface ArrayConstructor { - repeat(n: number, value?: any): any[]; + repeat(n: number, value?: T): T[]; } } diff --git a/src/array/repeat/method.ts b/src/array/repeat/method.ts index 5b5f1744..70c234f5 100644 --- a/src/array/repeat/method.ts +++ b/src/array/repeat/method.ts @@ -1,3 +1,4 @@ -const method = (n: number, value: T = 0 as any): T[] => Array(n).fill(value); +const method = (n: number, value: T = 0 as any): T[] => + Array(n).fill(value); export = method; diff --git a/src/array/repeat/test.ts b/src/array/repeat/test.ts index 787e2e90..fdcf9826 100644 --- a/src/array/repeat/test.ts +++ b/src/array/repeat/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.repeat", () => { test("Array.repeat(5, 2) returns [2,2,2,2,2]", () => { diff --git a/src/array/sample/index.ts b/src/array/sample/index.ts index 84c414e6..0bd322d0 100644 --- a/src/array/sample/index.ts +++ b/src/array/sample/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/sample/method.ts b/src/array/sample/method.ts index 11cabbc1..2c97313e 100644 --- a/src/array/sample/method.ts +++ b/src/array/sample/method.ts @@ -1,3 +1,4 @@ -const method = (arr: T[]): T => arr[Math.floor(Math.random() * arr.length)]; +const method = (arr: T[]): T => + arr[Math.floor(Math.random() * arr.length)]; export = method; diff --git a/src/array/sample/test.ts b/src/array/sample/test.ts index 53628a49..5549ecfd 100644 --- a/src/array/sample/test.ts +++ b/src/array/sample/test.ts @@ -1,7 +1,7 @@ -import "./index"; +import "."; describe("Array.prototype.sample", () => { - test("[\"a\", \"b\", \"c\", \"d\"].sample() returns \"a\" or \"b\" or \"c\" or \"d\"", () => { + test('["a", "b", "c", "d"].sample() returns "a" or "b" or "c" or "d"', () => { expect(["a", "b", "c", "d"].sample()).toMatch(/[abcd]/); }); }); diff --git a/src/array/shuffle/index.ts b/src/array/shuffle/index.ts index 671257c2..696fa2cd 100644 --- a/src/array/shuffle/index.ts +++ b/src/array/shuffle/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/shuffle/test.ts b/src/array/shuffle/test.ts index d0a0c711..38e7304f 100644 --- a/src/array/shuffle/test.ts +++ b/src/array/shuffle/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.shuffle", () => { test("[1, 2, 3].shuffle() returns somthing like [2,3,1]", () => { diff --git a/src/array/skip/index.ts b/src/array/skip/index.ts index 4eb00a55..cca19ad3 100644 --- a/src/array/skip/index.ts +++ b/src/array/skip/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/skip/test.ts b/src/array/skip/test.ts index f3765cc8..e4d15201 100644 --- a/src/array/skip/test.ts +++ b/src/array/skip/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.skip", () => { test("[2, 1, 2, 5].skip(1) returns [1,2,5]", () => { diff --git a/src/array/sortBy/index.ts b/src/array/sortBy/index.ts index a6b8bfc7..7cb06651 100644 --- a/src/array/sortBy/index.ts +++ b/src/array/sortBy/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { @@ -8,7 +8,8 @@ declare global { } /** - * Groups the elements of an array based on the given function and returns the count of elements in each group + * Groups the elements of an array based on the given function and + * returns the count of elements in each group * @memberof Array.prototype * @function sortBy * @param {String|Function} fn diff --git a/src/array/sortBy/method.ts b/src/array/sortBy/method.ts index 299c6608..f7995b8d 100644 --- a/src/array/sortBy/method.ts +++ b/src/array/sortBy/method.ts @@ -1,4 +1,4 @@ -import * as isString from "../../string/isString/method"; +import isString from "../../string/isString/method"; import { pathToKeys } from "../../utils"; const method = (arr: T[], fn: string | ((value: T) => number)) => { @@ -7,7 +7,8 @@ const method = (arr: T[], fn: string | ((value: T) => number)) => { if (isString(fn)) { const keys = pathToKeys(fn); - reducer = (value): number => keys.reduce((prev, cur) => (prev as any)[cur], value) as any; + reducer = (value): number => + keys.reduce((prev, cur) => (prev as any)[cur], value) as any; } return arr.sort((a, b) => reducer(a) - reducer(b)); diff --git a/src/array/sortBy/test.ts b/src/array/sortBy/test.ts index 07d4b0d2..2492bccd 100644 --- a/src/array/sortBy/test.ts +++ b/src/array/sortBy/test.ts @@ -1,13 +1,20 @@ -import "./index"; +import "."; describe("Array.prototype.sortBy", () => { test("['five', 'three', 'one'].sortBy('length') returns ['one', 'five', 'three']", () => { - expect(["five", "three", "one"].sortBy("length")) - .toEqual(["one", "five", "three"]); + expect(["five", "three", "one"].sortBy("length")).toEqual([ + "one", + "five", + "three", + ]); }); + // tslint:disable-next-line: max-line-length test("['five', 'three', 'one'].sortBy((value) => -value.length) returns ['three', 'five', 'one']", () => { - expect(["five", "three", "one"].sortBy((value) => -value.length)) - .toEqual(["three", "five", "one"]); + expect(["five", "three", "one"].sortBy(value => -value.length)).toEqual([ + "three", + "five", + "one", + ]); }); }); diff --git a/src/array/sum/index.ts b/src/array/sum/index.ts index 20e0c7a8..316547b3 100644 --- a/src/array/sum/index.ts +++ b/src/array/sum/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/sum/method.ts b/src/array/sum/method.ts index 390bc966..e6ee87d1 100644 --- a/src/array/sum/method.ts +++ b/src/array/sum/method.ts @@ -4,7 +4,11 @@ const method = (arr: T[], path?: string): number => { if (path) { const keys = pathToKeys(path); - const reducer = (item: T): number => keys.reduce((prev, cur) => (prev && (prev as any)[cur]) || 0, item) as any; + const reducer = (item: T): number => + keys.reduce( + (prev, cur) => (prev && (prev as any)[cur]) || 0, + item, + ) as any; return arr.reduce((prev, cur) => prev + reducer(cur), 0); } diff --git a/src/array/sum/test.ts b/src/array/sum/test.ts index 4db0ec3f..bc2a584a 100644 --- a/src/array/sum/test.ts +++ b/src/array/sum/test.ts @@ -1,19 +1,21 @@ -import "./index"; +import "."; describe("Array.prototype.sum", () => { test("[1, 2, 3].sum() returns 6", () => { expect([1, 2, 3].sum()).toBe(6); }); - test("[{a: 1}, {a: 2}, {a: 3}].sum(\"a\") returns 6", () => { + test('[{a: 1}, {a: 2}, {a: 3}].sum("a") returns 6', () => { expect([{ a: 1 }, { a: 2 }, { a: 3 }].sum("a")).toBe(6); }); - test("[{a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}].sum(\"a.b\") returns 6", () => { - expect([{ a: { b: 1 } }, { a: { b: 2 } }, { a: { b: 3 } }].sum("a.b")).toBe(6); + test('[{a: {b: 1}}, {a: {b: 2}}, {a: {b: 3}}].sum("a.b") returns 6', () => { + expect([{ a: { b: 1 } }, { a: { b: 2 } }, { a: { b: 3 } }].sum("a.b")).toBe( + 6, + ); }); - test("[{a: 1}, {a: 2}, {a: 3}].sum(\"b\") returns 0", () => { + test('[{a: 1}, {a: 2}, {a: 3}].sum("b") returns 0', () => { expect([{ a: 1 }, { a: 2 }, { a: 3 }].sum("b")).toBe(0); }); }); diff --git a/src/array/tail/index.ts b/src/array/tail/index.ts index 790fcad2..9478491d 100644 --- a/src/array/tail/index.ts +++ b/src/array/tail/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/tail/method.ts b/src/array/tail/method.ts index 9da4431f..b352941c 100644 --- a/src/array/tail/method.ts +++ b/src/array/tail/method.ts @@ -1,3 +1,3 @@ -const method = (arr: T[]): T[] => arr.length > 1 ? arr.slice(1) : []; +const method = (arr: T[]): T[] => (arr.length > 1 ? arr.slice(1) : []); export = method; diff --git a/src/array/tail/test.ts b/src/array/tail/test.ts index 4e8621f9..f68b63a3 100644 --- a/src/array/tail/test.ts +++ b/src/array/tail/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.tail", () => { test("[1, 2, 3].tail() returns [2, 3]", () => { diff --git a/src/array/toCSV/index.ts b/src/array/toCSV/index.ts index 6c8a6999..3e67be05 100644 --- a/src/array/toCSV/index.ts +++ b/src/array/toCSV/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/toCSV/method.ts b/src/array/toCSV/method.ts index ca108340..dd1959d7 100644 --- a/src/array/toCSV/method.ts +++ b/src/array/toCSV/method.ts @@ -1,4 +1,4 @@ -const toCSV = (arr: T[], delimiter = ",") => arr - .map((v: any) => v.map((x: any) => `"${x}"`).join(delimiter)).join("\n"); +const toCSV = (arr: T[], delimiter = ",") => + arr.map((v: any) => v.map((x: any) => `"${x}"`).join(delimiter)).join("\n"); export = toCSV; diff --git a/src/array/toCSV/test.ts b/src/array/toCSV/test.ts index 9c61ae9b..aa5458a4 100644 --- a/src/array/toCSV/test.ts +++ b/src/array/toCSV/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.toCSV", () => { test("[['a', 'b'], ['c', 'd']].toCSV() returns '\"a\",\"b\"\\n\"c\",\"d\"'", () => { diff --git a/src/array/union/index.ts b/src/array/union/index.ts index 3916de37..ded74785 100644 --- a/src/array/union/index.ts +++ b/src/array/union/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/union/method.ts b/src/array/union/method.ts index 968561f5..1629a3ea 100644 --- a/src/array/union/method.ts +++ b/src/array/union/method.ts @@ -1,3 +1,4 @@ -const method = (arr: T[], array: P[]): Array => Array.from(new Set([...arr, ...array])); +const method = (arr: T[], array: P[]): Array => + Array.from(new Set([...arr, ...array])); export = method; diff --git a/src/array/union/test.ts b/src/array/union/test.ts index ae7d49f1..270941fc 100644 --- a/src/array/union/test.ts +++ b/src/array/union/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Array.prototype.union", () => { test("[1, 2, 3].union([4, 3, 2]) returns [1,2,3,4]", () => { diff --git a/src/array/unwind/index.ts b/src/array/unwind/index.ts index 919e8edc..419e019c 100644 --- a/src/array/unwind/index.ts +++ b/src/array/unwind/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/unwind/method.ts b/src/array/unwind/method.ts index dc19c2ee..5c88f99b 100644 --- a/src/array/unwind/method.ts +++ b/src/array/unwind/method.ts @@ -1,11 +1,16 @@ const method = (arr: T[], path: string) => { - return arr.reduce((prev, cur) => { - const values: any[] = (cur as any)[path]; + return arr.reduce( + (prev, cur) => { + const values: any[] = (cur as any)[path]; - values.forEach((value) => prev.push(Object.assign({}, cur, { [path]: value }) as any)); + values.forEach(value => + prev.push(Object.assign({}, cur, { [path]: value }) as any), + ); - return prev; - }, [] as P[]); + return prev; + }, + [] as P[], + ); }; export = method; diff --git a/src/array/unwind/test.ts b/src/array/unwind/test.ts index 36a98629..b997e176 100644 --- a/src/array/unwind/test.ts +++ b/src/array/unwind/test.ts @@ -1,9 +1,18 @@ -import "./index"; +import "."; describe("Array.prototype.unwind", () => { - test("[{foo: [\"bar 1\", \"bar 2\"]}, {foo: [\"bar 3\", \"bar 4\", \"bar 5\"]}].unwind(\"foo\")", - () => { - expect([{ foo: ["bar 1", "bar 2"] }, { foo: ["bar 3", "bar 4", "bar 5"] }].unwind("foo")) - .toEqual([{ foo: "bar 1" }, { foo: "bar 2" }, { foo: "bar 3" }, { foo: "bar 4" }, { foo: "bar 5" }]); - }); + test('[{foo: ["bar 1", "bar 2"]}, {foo: ["bar 3", "bar 4", "bar 5"]}].unwind("foo")', () => { + expect( + [ + { foo: ["bar 1", "bar 2"] }, + { foo: ["bar 3", "bar 4", "bar 5"] }, + ].unwind("foo"), + ).toEqual([ + { foo: "bar 1" }, + { foo: "bar 2" }, + { foo: "bar 3" }, + { foo: "bar 4" }, + { foo: "bar 5" }, + ]); + }); }); diff --git a/src/array/where/index.ts b/src/array/where/index.ts index 055a5bcc..37485f14 100644 --- a/src/array/where/index.ts +++ b/src/array/where/index.ts @@ -1,13 +1,13 @@ -import * as method from "./method"; -import * as types from "../../types"; -import { addPrototype } from "../../utils"; +import { addPrototype, Operator } from "../../utils"; +import method from "./method"; declare global { interface Array { where(value: any): T[]; where(field: string, value: any): T[]; - where(operator: types.Operator, value: any): T[]; - where(field: string, operator: types.Operator, value: any): T[]; + // tslint:disable-next-line: unified-signatures + where(operator: Operator, value: any): T[]; + where(field: string, operator: Operator, value: any): T[]; } } diff --git a/src/array/where/method.ts b/src/array/where/method.ts index e72f0b12..06f2464d 100644 --- a/src/array/where/method.ts +++ b/src/array/where/method.ts @@ -1,50 +1,63 @@ -import * as types from "../../types"; -import * as contains from "../contains/method"; -import { filter } from "../../utils"; +import { filter, Operator, OPERATOR } from "../../utils"; +import contains from "../contains/method"; + +const OPERATORS = [ + OPERATOR.LT, + OPERATOR.LTE, + OPERATOR.EQ, + OPERATOR.NE, + OPERATOR.GTE, + OPERATOR.GT, +]; const method = ( - arr: T[], field: string | types.Operator | any, - operator?: types.Operator | any, value?: any + arr: T[], + field: string | Operator | any, + operator?: Operator | any, + value?: any, ) => { - if (operator === undefined) { - value = field as any; - field = undefined; - operator = "="; - } else if (value === undefined) - if (!contains(["<", "<=", "=", "<>", ">=", ">"], field)) { - value = operator as any; - operator = "="; - } else { - value = operator as any; - operator = field as types.Operator; - field = undefined; - } - - let iterator: (item: any) => boolean; - switch (operator) { - case "<": - iterator = (item) => item < value; - break; - case "<=": - iterator = (item) => item <= value; - break; - case "=": - iterator = (item) => item === value; - break; - case "<>": - iterator = (item) => item !== value; - break; - case ">=": - iterator = (item) => item >= value; - break; - case ">": - iterator = (item) => item > value; - break; - default: - throw new TypeError(`Expected 'operator' to be one of ['<', '<=', '=', '<>', '>=', '>'], got ${operator}`); + if (operator === undefined) { + value = field as any; + field = undefined; + operator = OPERATOR.EQ; + } else if (value === undefined) { + if (!contains(OPERATORS, field)) { + value = operator as any; + operator = OPERATOR.EQ; + } else { + value = operator as any; + operator = field as Operator; + field = undefined; } + } + + let iterator: (item: any) => boolean; + switch (operator) { + case OPERATOR.LT: + iterator = item => item < value; + break; + case OPERATOR.LTE: + iterator = item => item <= value; + break; + case OPERATOR.EQ: + iterator = item => item === value; + break; + case OPERATOR.NE: + iterator = item => item !== value; + break; + case OPERATOR.GTE: + iterator = item => item >= value; + break; + case OPERATOR.GT: + iterator = item => item > value; + break; + default: + throw new TypeError( + `Expected 'operator' to be one of ${OPERATORS}, got ${operator}`, + ); + } - return filter(arr, field, iterator); + return filter(arr, field, iterator); }; export = method; diff --git a/src/array/where/test.ts b/src/array/where/test.ts index 60eda6e8..2ae589ec 100644 --- a/src/array/where/test.ts +++ b/src/array/where/test.ts @@ -1,39 +1,49 @@ -import "./index"; +import "."; describe("Array.prototype.where", () => { test("[1, 2, 2, 3, 4, 4, 5].where(4) returns [4,4]", () => { expect([1, 2, 2, 3, 4, 4, 5].where(4)).toEqual([4, 4]); }); - test("[1, 2, 2, 3, 4, 4, 5].where(\"<\", 4) returns [1,2,2,3]", () => { + test('[1, 2, 2, 3, 4, 4, 5].where("<", 4) returns [1,2,2,3]', () => { expect([1, 2, 2, 3, 4, 4, 5].where("<", 4)).toEqual([1, 2, 2, 3]); }); - test("[1, 2, 2, 3, 4, 4, 5].where(\"<=\", 4) returns [1,2,2,3,4,4]", () => { + test('[1, 2, 2, 3, 4, 4, 5].where("<=", 4) returns [1,2,2,3,4,4]', () => { expect([1, 2, 2, 3, 4, 4, 5].where("<=", 4)).toEqual([1, 2, 2, 3, 4, 4]); }); - test("[{count:1}, {count:20}, {count:15}].where(\"count\", 15) returns [{count:15}]", () => { - expect([{ count: 1 }, { count: 20 }, { count: 15 }].where("count", 15)).toEqual([{ count: 15 }]); + test('[{count:1}, {count:20}, {count:15}].where("count", 15) returns [{count:15}]', () => { + expect( + [{ count: 1 }, { count: 20 }, { count: 15 }].where("count", 15), + ).toEqual([{ count: 15 }]); }); - test("[{count:1}, {count:20}, {count:15}].where(\"count\", \"<>\", 15) returns [{count:15}]", () => { - expect([{ count: 1 }, { count: 20 }, { count: 15 }].where("count", "<>", 15)) - .toEqual([{ count: 1 }, { count: 20 }]); + test('[{count:1}, {count:20}, {count:15}].where("count", "<>", 15) returns [{count:15}]', () => { + expect( + [{ count: 1 }, { count: 20 }, { count: 15 }].where("count", "<>", 15), + ).toEqual([{ count: 1 }, { count: 20 }]); }); - test("[{count:1}, {count:20}, {count:15}].where(\"count\", \">=\", 15) returns [{count:20},{count:15}]", () => { - expect([{ count: 1 }, { count: 20 }, { count: 15 }].where("count", ">=", 15)) - .toEqual([{ count: 20 }, { count: 15 }]); + test('[{count:1}, {count:20}, {count:15}].where("count", ">=", 15) returns [{count:20},{count:15}]', () => { + expect( + [{ count: 1 }, { count: 20 }, { count: 15 }].where("count", ">=", 15), + ).toEqual([{ count: 20 }, { count: 15 }]); }); - test("[{count:1}, {count:20}, {count:15}].where(\"count\", \">\", 15) returns [{count:20}]", () => { - expect([{ count: 1 }, { count: 20 }, { count: 15 }].where("count", ">", 15)) - .toEqual([{ count: 20 }]); + test('[{count:1}, {count:20}, {count:15}].where("count", ">", 15) returns [{count:20}]', () => { + expect( + [{ count: 1 }, { count: 20 }, { count: 15 }].where("count", ">", 15), + ).toEqual([{ count: 20 }]); }); - test("[{count:1}, {count:20}, {count:15}].where(\"count\", \"like\", 15) throws TypeError", () => { - expect(() => [{ count: 1 }, { count: 20 }, { count: 15 }].where("count", "like" as any, 15)) - .toThrowError(TypeError); + test('[{count:1}, {count:20}, {count:15}].where("count", "like", 15) throws TypeError', () => { + expect(() => + [{ count: 1 }, { count: 20 }, { count: 15 }].where( + "count", + "like" as any, + 15, + ), + ).toThrowError(TypeError); }); }); diff --git a/src/array/whereBetween/index.ts b/src/array/whereBetween/index.ts index 25554360..befe0afe 100644 --- a/src/array/whereBetween/index.ts +++ b/src/array/whereBetween/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/whereBetween/method.ts b/src/array/whereBetween/method.ts index 53ae7f73..6888236f 100644 --- a/src/array/whereBetween/method.ts +++ b/src/array/whereBetween/method.ts @@ -1,15 +1,20 @@ import { filter } from "../../utils"; -const method = (arr: T[], field: string | any, start: any, end?: any) => { - if (end === undefined) { - end = start as any; - start = field as any; - field = undefined as any; - } +const method = ( + arr: T[], + field: string | any, + start: any, + end?: any, +) => { + if (end === undefined) { + end = start as any; + start = field as any; + field = undefined as any; + } - const iterator = (item: any) => item >= start && item <= end; + const iterator = (item: any) => item >= start && item <= end; - return filter(arr, field, iterator); + return filter(arr, field, iterator); }; export = method; diff --git a/src/array/whereBetween/test.ts b/src/array/whereBetween/test.ts index b964b078..d574c52d 100644 --- a/src/array/whereBetween/test.ts +++ b/src/array/whereBetween/test.ts @@ -1,12 +1,14 @@ -import "./index"; +import "."; describe("Array.prototype.whereBetween", () => { test("[1, 2, 2, 3, 4, 4, 5].whereBetween(3,4) returns [3,4,4]", () => { expect([1, 2, 2, 3, 4, 4, 5].whereBetween(3, 4)).toEqual([3, 4, 4]); }); - test("[{count:1}, {count:20}, {count:15}].whereBetween(\"count\", 1, 15) returns [{count:1},{count:15}]", () => { - expect([{ count: 1 }, { count: 20 }, { count: 15 }].whereBetween("count", 1, 15)) - .toEqual([{ count: 1 }, { count: 15 }]); + // tslint:disable-next-line: max-line-length + test('[{count:1}, {count:20}, {count:15}].whereBetween("count", 1, 15) returns [{count:1},{count:15}]', () => { + expect( + [{ count: 1 }, { count: 20 }, { count: 15 }].whereBetween("count", 1, 15), + ).toEqual([{ count: 1 }, { count: 15 }]); }); }); diff --git a/src/array/whereIn/index.ts b/src/array/whereIn/index.ts index d936a56e..21895520 100644 --- a/src/array/whereIn/index.ts +++ b/src/array/whereIn/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/whereIn/method.ts b/src/array/whereIn/method.ts index 4b5b5ab2..c6443706 100644 --- a/src/array/whereIn/method.ts +++ b/src/array/whereIn/method.ts @@ -1,14 +1,14 @@ import { filter } from "../../utils"; const method = (arr: T[], field: string | any[], value?: any[]) => { - if (value === undefined) { - value = field as any[]; - field = undefined as any; - } + if (value === undefined) { + value = field as any[]; + field = undefined as any; + } - const iterator = (item: T) => (value as any[]).indexOf(item) !== -1; + const iterator = (item: T) => (value as any[]).indexOf(item) !== -1; - return filter(arr, field as string, iterator); + return filter(arr, field as string, iterator); }; export = method; diff --git a/src/array/whereIn/test.ts b/src/array/whereIn/test.ts index 25b2dec9..647d0062 100644 --- a/src/array/whereIn/test.ts +++ b/src/array/whereIn/test.ts @@ -1,12 +1,14 @@ -import "./index"; +import "."; describe("Array.prototype.whereIn", () => { test("[1, 2, 2, 3, 4, 4, 5].whereIn([3,4]) returns [3,4,4]", () => { expect([1, 2, 2, 3, 4, 4, 5].whereIn([3, 4])).toEqual([3, 4, 4]); }); - test("[{count:1}, {count:20}, {count:15}].whereIn(\"count\", [1, 15]) returns [{count:1},{count:15}]", () => { - expect([{ count: 1 }, { count: 20 }, { count: 15 }].whereIn("count", [1, 15])) - .toEqual([{ count: 1 }, { count: 15 }]); + // tslint:disable-next-line: max-line-length + test('[{count:1}, {count:20}, {count:15}].whereIn("count", [1, 15]) returns [{count:1},{count:15}]', () => { + expect( + [{ count: 1 }, { count: 20 }, { count: 15 }].whereIn("count", [1, 15]), + ).toEqual([{ count: 1 }, { count: 15 }]); }); }); diff --git a/src/array/whereLike/index.ts b/src/array/whereLike/index.ts index 891d58fe..d6990931 100644 --- a/src/array/whereLike/index.ts +++ b/src/array/whereLike/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { @@ -17,6 +17,7 @@ declare global { * @returns {Array} * @example * ["foo", "bar", "hello", "world"].whereLike("o"); // ["foo","hello","world"] - * [{foo:"hello"}, {foo:"bar"}, {foo:"world"}].whereLike("foo", /o/i); // [{foo:"hello"},{foo:"world"}] + * [{foo:"hello"}, {foo:"bar"}, {foo:"world"}] + * .whereLike("foo", /o/i); // [{foo:"hello"},{foo:"world"}] */ addPrototype(Array, "whereLike", method); diff --git a/src/array/whereLike/method.ts b/src/array/whereLike/method.ts index ccb8f0da..cfa2bf03 100644 --- a/src/array/whereLike/method.ts +++ b/src/array/whereLike/method.ts @@ -1,17 +1,21 @@ -import * as isString from "../../string/isString/method"; +import isString from "../../string/isString/method"; import { filter } from "../../utils"; -const method = (arr: T[], field: string | RegExp, value?: string | RegExp) => { - if (value === undefined) { - value = field as string | RegExp; - field = undefined as any; - } +const method = ( + arr: T[], + field: string | RegExp, + value?: string | RegExp, +) => { + if (value === undefined) { + value = field as string | RegExp; + field = undefined as any; + } - if (isString(value)) value = new RegExp(value, "i"); + if (isString(value)) value = new RegExp(value, "i"); - const iterator = (item: any) => (value as RegExp).test(item); + const iterator = (item: any) => (value as RegExp).test(item); - return filter(arr, field as string, iterator); + return filter(arr, field as string, iterator); }; export = method; diff --git a/src/array/whereLike/test.ts b/src/array/whereLike/test.ts index 35e7a59e..8165967a 100644 --- a/src/array/whereLike/test.ts +++ b/src/array/whereLike/test.ts @@ -1,14 +1,21 @@ -import "./index"; +import "."; describe("Array.prototype.whereLike", () => { - test("[\"foo\", \"bar\", \"hello\", \"world\"].whereLike(\"o\") returns [\"foo\",\"hello\",\"world\"]", () => { - expect(["foo", "bar", "hello", "world"].whereLike("o")).toEqual(["foo", "hello", "world"]); + test('["foo", "bar", "hello", "world"].whereLike("o") returns ["foo","hello","world"]', () => { + expect(["foo", "bar", "hello", "world"].whereLike("o")).toEqual([ + "foo", + "hello", + "world", + ]); }); - test( - "[{foo:\"hello\"},{foo:\"bar\"},{foo:\"world\"}].whereLike(\"foo\",/o/i) returns [{foo:\"hello\"},{foo:\"world\"}]", - () => { - expect([{ foo: "hello" }, { foo: "bar" }, { foo: "world" }].whereLike("foo", /o/i)) - .toEqual([{ foo: "hello" }, { foo: "world" }]); - }); + // tslint:disable-next-line: max-line-length + test('[{foo:"hello"},{foo:"bar"},{foo:"world"}].whereLike("foo",/o/i) returns [{foo:"hello"},{foo:"world"}]', () => { + expect( + [{ foo: "hello" }, { foo: "bar" }, { foo: "world" }].whereLike( + "foo", + /o/i, + ), + ).toEqual([{ foo: "hello" }, { foo: "world" }]); + }); }); diff --git a/src/array/whereNotBetween/index.ts b/src/array/whereNotBetween/index.ts index faceab3a..6dd83694 100644 --- a/src/array/whereNotBetween/index.ts +++ b/src/array/whereNotBetween/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/whereNotBetween/method.ts b/src/array/whereNotBetween/method.ts index d0ebec60..0ad4889f 100644 --- a/src/array/whereNotBetween/method.ts +++ b/src/array/whereNotBetween/method.ts @@ -1,15 +1,20 @@ import { filter } from "../../utils"; -const method = (arr: T[], field: string | any, start: any, end?: any) => { - if (end === undefined) { - end = start as any; - start = field as any; - field = undefined as any; - } +const method = ( + arr: T[], + field: string | any, + start: any, + end?: any, +) => { + if (end === undefined) { + end = start as any; + start = field as any; + field = undefined as any; + } - const iterator = (item: any) => item < start || item > end; + const iterator = (item: any) => item < start || item > end; - return filter(arr, field, iterator); + return filter(arr, field, iterator); }; export = method; diff --git a/src/array/whereNotBetween/test.ts b/src/array/whereNotBetween/test.ts index a61b012c..9b28523f 100644 --- a/src/array/whereNotBetween/test.ts +++ b/src/array/whereNotBetween/test.ts @@ -1,12 +1,18 @@ -import "./index"; +import "."; describe("Array.prototype.whereNotBetween", () => { test("[1, 2, 2, 3, 4, 4, 5].whereNotBetween(3,4) returns [1,2,2,5]", () => { expect([1, 2, 2, 3, 4, 4, 5].whereNotBetween(3, 4)).toEqual([1, 2, 2, 5]); }); - test("[{count:1}, {count:20}, {count:15}].whereNotBetween(\"count\", 1, 15) returns [{count:20}]", () => { - expect([{ count: 1 }, { count: 20 }, { count: 15 }].whereNotBetween("count", 1, 15)) - .toEqual([{ count: 20 }]); + // tslint:disable-next-line: max-line-length + test('[{count:1}, {count:20}, {count:15}].whereNotBetween("count", 1, 15) returns [{count:20}]', () => { + expect( + [{ count: 1 }, { count: 20 }, { count: 15 }].whereNotBetween( + "count", + 1, + 15, + ), + ).toEqual([{ count: 20 }]); }); }); diff --git a/src/array/whereNotIn/index.ts b/src/array/whereNotIn/index.ts index 7a269545..3e8d57f2 100644 --- a/src/array/whereNotIn/index.ts +++ b/src/array/whereNotIn/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/whereNotIn/method.ts b/src/array/whereNotIn/method.ts index 35dc4a03..8e70532e 100644 --- a/src/array/whereNotIn/method.ts +++ b/src/array/whereNotIn/method.ts @@ -1,14 +1,14 @@ import { filter } from "../../utils"; const method = (arr: T[], field: string | any[], value?: any[]) => { - if (value === undefined) { - value = field as any[]; - field = undefined as any; - } + if (value === undefined) { + value = field as any[]; + field = undefined as any; + } - const iterator = (item: any) => (value as any[]).indexOf(item) === -1; + const iterator = (item: any) => (value as any[]).indexOf(item) === -1; - return filter(arr, field as string, iterator); + return filter(arr, field as string, iterator); }; export = method; diff --git a/src/array/whereNotIn/test.ts b/src/array/whereNotIn/test.ts index e5f07416..87804ce0 100644 --- a/src/array/whereNotIn/test.ts +++ b/src/array/whereNotIn/test.ts @@ -1,12 +1,14 @@ -import "./index"; +import "."; describe("Array.prototype.whereNotIn", () => { test("[1, 2, 2, 3, 4, 4, 5].whereNotIn([3,4]) returns [1,2,2,5]", () => { expect([1, 2, 2, 3, 4, 4, 5].whereNotIn([3, 4])).toEqual([1, 2, 2, 5]); }); - test("[{count:1}, {count:20}, {count:15}].whereNotIn(\"count\", [1, 15]) returns [{count:20}]", () => { - expect([{ count: 1 }, { count: 20 }, { count: 15 }].whereNotIn("count", [1, 15])) - .toEqual([{ count: 20 }]); + // tslint:disable-next-line: max-line-length + test('[{count:1}, {count:20}, {count:15}].whereNotIn("count", [1, 15]) returns [{count:20}]', () => { + expect( + [{ count: 1 }, { count: 20 }, { count: 15 }].whereNotIn("count", [1, 15]), + ).toEqual([{ count: 20 }]); }); }); diff --git a/src/array/whereNotLike/index.ts b/src/array/whereNotLike/index.ts index 848b916b..05ac24aa 100644 --- a/src/array/whereNotLike/index.ts +++ b/src/array/whereNotLike/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/whereNotLike/method.ts b/src/array/whereNotLike/method.ts index b3304d2b..db2b2b88 100644 --- a/src/array/whereNotLike/method.ts +++ b/src/array/whereNotLike/method.ts @@ -1,17 +1,21 @@ -import * as isString from "../../string/isString/method"; +import isString from "../../string/isString/method"; import { filter } from "../../utils"; -const method = (arr: T[], field: string | RegExp, value?: string | RegExp) => { - if (value === undefined) { - value = field as string | RegExp; - field = undefined as any; - } +const method = ( + arr: T[], + field: string | RegExp, + value?: string | RegExp, +) => { + if (value === undefined) { + value = field as string | RegExp; + field = undefined as any; + } - if (isString(value)) value = new RegExp(value, "i"); + if (isString(value)) value = new RegExp(value, "i"); - const iterator = (item: any) => !(value as RegExp).test(item); + const iterator = (item: any) => !(value as RegExp).test(item); - return filter(arr, field as string, iterator); + return filter(arr, field as string, iterator); }; export = method; diff --git a/src/array/whereNotLike/test.ts b/src/array/whereNotLike/test.ts index 2d740b1a..65fa6603 100644 --- a/src/array/whereNotLike/test.ts +++ b/src/array/whereNotLike/test.ts @@ -1,14 +1,17 @@ -import "./index"; +import "."; describe("Array.prototype.whereNotLike", () => { - test("[\"foo\", \"bar\", \"hello\", \"world\"].whereNotLike(\"o\") returns [\"bar\"]", () => { + test('["foo", "bar", "hello", "world"].whereNotLike("o") returns ["bar"]', () => { expect(["foo", "bar", "hello", "world"].whereNotLike("o")).toEqual(["bar"]); }); - test( - "[{foo:\"hello\"}, {foo:\"bar\"}, {foo:\"world\"}].whereNotLike(\"foo\", /o/i) returns [{foo:\"bar\"}]", - () => { - expect([{ foo: "hello" }, { foo: "bar" }, { foo: "world" }].whereNotLike("foo", /o/i)) - .toEqual([{ foo: "bar" }]); - }); + // tslint:disable-next-line: max-line-length + test('[{foo:"hello"}, {foo:"bar"}, {foo:"world"}].whereNotLike("foo", /o/i) returns [{foo:"bar"}]', () => { + expect( + [{ foo: "hello" }, { foo: "bar" }, { foo: "world" }].whereNotLike( + "foo", + /o/i, + ), + ).toEqual([{ foo: "bar" }]); + }); }); diff --git a/src/array/whereNotNull/index.ts b/src/array/whereNotNull/index.ts index 298e6e6f..a412f02b 100644 --- a/src/array/whereNotNull/index.ts +++ b/src/array/whereNotNull/index.ts @@ -1,10 +1,9 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { - whereNotNull(): T[]; - whereNotNull(field: string): T[]; + whereNotNull(field?: string): T[]; } } diff --git a/src/array/whereNotNull/method.ts b/src/array/whereNotNull/method.ts index 514c165f..66e06e50 100644 --- a/src/array/whereNotNull/method.ts +++ b/src/array/whereNotNull/method.ts @@ -1,9 +1,9 @@ import { filter } from "../../utils"; const method = (arr: T[], field?: string) => { - const iterator = (item: any) => item !== null && item !== undefined; + const iterator = (item: any) => item !== null && item !== undefined; - return filter(arr, field, iterator); + return filter(arr, field, iterator); }; export = method; diff --git a/src/array/whereNotNull/test.ts b/src/array/whereNotNull/test.ts index ee451698..fcc35f92 100644 --- a/src/array/whereNotNull/test.ts +++ b/src/array/whereNotNull/test.ts @@ -1,12 +1,19 @@ -import "./index"; +import "."; describe("Array.prototype.whereNotNull", () => { test("[1, 2, 2, 3, null, undefined, 5].whereNotNull() returns [1,2,2,3,5]", () => { - expect([1, 2, 2, 3, null, undefined, 5].whereNotNull()).toEqual([1, 2, 2, 3, 5]); + expect([1, 2, 2, 3, null, undefined, 5].whereNotNull()).toEqual([ + 1, + 2, + 2, + 3, + 5, + ]); }); - test("[{count:1}, {count:null}, {foo:15}].whereNotNull(\"count\") returns [{count:1}]", () => { - expect([{ count: 1 }, { count: null }, { foo: 15 }].whereNotNull("count")) - .toEqual([{ count: 1 }]); + test('[{count:1}, {count:null}, {foo:15}].whereNotNull("count") returns [{count:1}]', () => { + expect( + [{ count: 1 }, { count: null }, { foo: 15 }].whereNotNull("count"), + ).toEqual([{ count: 1 }]); }); }); diff --git a/src/array/whereNull/index.ts b/src/array/whereNull/index.ts index 9509d067..65ca1371 100644 --- a/src/array/whereNull/index.ts +++ b/src/array/whereNull/index.ts @@ -1,10 +1,10 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { whereNull(): Array; - whereNull(field: string): Array; + whereNull(field: string): T[]; } } diff --git a/src/array/whereNull/method.ts b/src/array/whereNull/method.ts index b6204352..3093cb27 100644 --- a/src/array/whereNull/method.ts +++ b/src/array/whereNull/method.ts @@ -1,9 +1,9 @@ import { filter } from "../../utils"; const method = (arr: T[], field?: string) => { - const iterator = (item: any) => item === null || item === undefined; + const iterator = (item: any) => item === null || item === undefined; - return filter(arr, field, iterator); + return filter(arr, field, iterator); }; export = method; diff --git a/src/array/whereNull/test.ts b/src/array/whereNull/test.ts index 90756b9e..a4125029 100644 --- a/src/array/whereNull/test.ts +++ b/src/array/whereNull/test.ts @@ -1,12 +1,17 @@ -import "./index"; +import "."; describe("Array.prototype.whereNull", () => { test("[1, 2, 2, 3, null, undefined, 5].whereNull() returns [null, undefined]", () => { - expect([1, 2, 2, 3, null, undefined, 5].whereNull()).toEqual([null, undefined]); + expect([1, 2, 2, 3, null, undefined, 5].whereNull()).toEqual([ + null, + undefined, + ]); }); - test("[{count:1}, {count:null}, {foo:15}].whereNull(\"count\") returns [{count:null},{foo:15}]", () => { - expect([{ count: 1 }, { count: null }, { foo: 15 }].whereNull("count")) - .toEqual([{ count: null }, { foo: 15 }]); + // tslint:disable-next-line: max-line-length + test('[{count:1}, {count:null}, {foo:15}].whereNull("count") returns [{count:null},{foo:15}]', () => { + expect( + [{ count: 1 }, { count: null }, { foo: 15 }].whereNull("count"), + ).toEqual([{ count: null }, { foo: 15 }]); }); }); diff --git a/src/array/zip/index.ts b/src/array/zip/index.ts index b57b68d7..a6b155f9 100644 --- a/src/array/zip/index.ts +++ b/src/array/zip/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/zip/method.ts b/src/array/zip/method.ts index 87bc0b13..f6622510 100644 --- a/src/array/zip/method.ts +++ b/src/array/zip/method.ts @@ -1,9 +1,11 @@ const method = (arr: T[], ...arrays: any[][]): any[][] => { arrays = [arr, ...arrays]; - return Array.from({ length: Math.max(...arrays.map((x) => x.length)) }).map((_, i) => { - return Array.from({ length: arrays.length }, (_, k) => arrays[k][i]); - }); + return Array.from({ length: Math.max(...arrays.map(x => x.length)) }).map( + (_, i) => { + return Array.from({ length: arrays.length }, (__, k) => arrays[k][i]); + }, + ); }; export = method; diff --git a/src/array/zip/test.ts b/src/array/zip/test.ts index 770aad7e..1073b86c 100644 --- a/src/array/zip/test.ts +++ b/src/array/zip/test.ts @@ -1,11 +1,17 @@ -import "./index"; +import "."; describe("Array.prototype.zip", () => { - test("[\"a\", \"b\"].zip([1, 2], [true, false]) returns [[\"a\", 1, true], [\"b\", 2, false]]", () => { - expect(["a", "b"].zip([1, 2], [true, false])).toEqual([["a", 1, true], ["b", 2, false]]); + test('["a", "b"].zip([1, 2], [true, false]) returns [["a", 1, true], ["b", 2, false]]', () => { + expect(["a", "b"].zip([1, 2], [true, false])).toEqual([ + ["a", 1, true], + ["b", 2, false], + ]); }); - test("[\"a\"].zip([1, 2], [true, false]) returns [[\"a\", 1, true], [undefined, 2, false]]", () => { - expect(["a"].zip([1, 2], [true, false])).toEqual([["a", 1, true], [undefined, 2, false]]); + test('["a"].zip([1, 2], [true, false]) returns [["a", 1, true], [undefined, 2, false]]', () => { + expect(["a"].zip([1, 2], [true, false])).toEqual([ + ["a", 1, true], + [undefined, 2, false], + ]); }); }); diff --git a/src/array/zipObject/index.ts b/src/array/zipObject/index.ts index eeb7b1cf..5a9e3a24 100644 --- a/src/array/zipObject/index.ts +++ b/src/array/zipObject/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Array { diff --git a/src/array/zipObject/method.ts b/src/array/zipObject/method.ts index d19624f9..647f18db 100644 --- a/src/array/zipObject/method.ts +++ b/src/array/zipObject/method.ts @@ -1,5 +1,8 @@ const method = (arr: T[], array: any[]): object => { - return arr.reduce((obj: any, prop, index) => ((obj[prop] = array[index]), obj), {}); + return arr.reduce( + (obj: any, prop, index) => ((obj[prop] = array[index]), obj), + {}, + ); }; export = method; diff --git a/src/array/zipObject/test.ts b/src/array/zipObject/test.ts index 4498e606..e5a05f7f 100644 --- a/src/array/zipObject/test.ts +++ b/src/array/zipObject/test.ts @@ -1,11 +1,15 @@ -import "./index"; +import "."; describe("Array.prototype.zipObject", () => { - test("[\"a\", \"b\", \"c\"].zipObject([1, 2]) returns {a: 1, b: 2, c: undefined}", () => { - expect(["a", "b", "c"].zipObject([1, 2])).toEqual({ a: 1, b: 2, c: undefined }); + test('["a", "b", "c"].zipObject([1, 2]) returns {a: 1, b: 2, c: undefined}', () => { + expect(["a", "b", "c"].zipObject([1, 2])).toEqual({ + a: 1, + b: 2, + c: undefined, + }); }); - test("[\"a\", \"b\"].zipObject([1, 2, 3]) returns {a: 1, b: 2}", () => { + test('["a", "b"].zipObject([1, 2, 3]) returns {a: 1, b: 2}', () => { expect(["a", "b"].zipObject([1, 2, 3])).toEqual({ a: 1, b: 2 }); }); }); diff --git a/src/boolean/isBoolean/index.ts b/src/boolean/isBoolean/index.ts index 88d4ec61..2eef0890 100644 --- a/src/boolean/isBoolean/index.ts +++ b/src/boolean/isBoolean/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface BooleanConstructor { diff --git a/src/boolean/isBoolean/test.ts b/src/boolean/isBoolean/test.ts index d0386585..a839d550 100644 --- a/src/boolean/isBoolean/test.ts +++ b/src/boolean/isBoolean/test.ts @@ -1,13 +1,11 @@ -import "./index"; +import "."; describe("Boolean.isBoolean", () => { - test("Boolean.isBoolean(\"foo bar\") returns false", () => { - expect(Boolean.isBoolean("foo bar")) - .toBe(false); + test('Boolean.isBoolean("foo bar") returns false', () => { + expect(Boolean.isBoolean("foo bar")).toBe(false); }); test("Boolean.isBoolean(false) returns true", () => { - expect(Boolean.isBoolean(false)) - .toBe(true); + expect(Boolean.isBoolean(false)).toBe(true); }); }); diff --git a/src/boolean/methods.ts b/src/boolean/methods.ts index ae4ebabb..469faf49 100644 --- a/src/boolean/methods.ts +++ b/src/boolean/methods.ts @@ -1,5 +1,3 @@ -import * as isBoolean from "./isBoolean/method"; +import isBoolean from "./isBoolean/method"; -export { - isBoolean, -}; +export { isBoolean }; diff --git a/src/date/equals/index.ts b/src/date/equals/index.ts index 93b24cf6..f48eb4fc 100644 --- a/src/date/equals/index.ts +++ b/src/date/equals/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Date { diff --git a/src/date/equals/method.ts b/src/date/equals/method.ts index bff4e9cf..4bba0b66 100644 --- a/src/date/equals/method.ts +++ b/src/date/equals/method.ts @@ -1,5 +1,6 @@ -import * as isDate from "../isDate/method"; +import isDate from "../isDate/method"; -const method = (date: Date, value: any): boolean => isDate(value) && (date.getTime() === value.getTime()); +const method = (date: Date, value: any): boolean => + isDate(value) && date.getTime() === value.getTime(); export = method; diff --git a/src/date/equals/test.ts b/src/date/equals/test.ts index 81144e1c..d8af135e 100644 --- a/src/date/equals/test.ts +++ b/src/date/equals/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Date.prototype.equals", () => { test("date1.equals(new Date(date1)) returns true", () => { @@ -9,7 +9,7 @@ describe("Date.prototype.equals", () => { test("(new Date()).equals(new Date()) returns false", () => { const date1 = new Date(); - while ((new Date()).getTime() === date1.getTime()) { } + while (new Date().getTime() === date1.getTime()) {} const date2 = new Date(); expect(date1.equals(date2)).toBe(false); }); diff --git a/src/date/isDate/index.ts b/src/date/isDate/index.ts index 74c67f09..21f8ae4e 100644 --- a/src/date/isDate/index.ts +++ b/src/date/isDate/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface DateConstructor { diff --git a/src/date/isDate/method.ts b/src/date/isDate/method.ts index 5342a686..feedf060 100644 --- a/src/date/isDate/method.ts +++ b/src/date/isDate/method.ts @@ -1,4 +1,5 @@ -const method = (arg: any): arg is Date => arg instanceof Date || +const method = (arg: any): arg is Date => + arg instanceof Date || Object.prototype.toString.call(arg) === "[object Date]"; export = method; diff --git a/src/date/isDate/test.ts b/src/date/isDate/test.ts index 3be7a81a..55bcf4d0 100644 --- a/src/date/isDate/test.ts +++ b/src/date/isDate/test.ts @@ -1,13 +1,11 @@ -import "./index"; +import "."; describe("Date.isDate", () => { - test("Date.isDate(\"foo bar\") returns false", () => { - expect(Date.isDate("foo bar")) - .toBe(false); + test('Date.isDate("foo bar") returns false', () => { + expect(Date.isDate("foo bar")).toBe(false); }); test("Date.isDate(new Date()) returns true", () => { - expect(Date.isDate(new Date())) - .toBe(true); + expect(Date.isDate(new Date())).toBe(true); }); }); diff --git a/src/date/methods.ts b/src/date/methods.ts index b05977ad..702c8760 100644 --- a/src/date/methods.ts +++ b/src/date/methods.ts @@ -1,13 +1,7 @@ -import * as equals from "./equals/method"; -import * as isDate from "./isDate/method"; -import * as today from "./today/method"; -import * as tomorrow from "./tomorrow/method"; -import * as yesterday from "./yesterday/method"; +import equals from "./equals/method"; +import isDate from "./isDate/method"; +import today from "./today/method"; +import tomorrow from "./tomorrow/method"; +import yesterday from "./yesterday/method"; -export { - equals, - isDate, - today, - tomorrow, - yesterday, -}; +export { equals, isDate, today, tomorrow, yesterday }; diff --git a/src/date/today/index.ts b/src/date/today/index.ts index 9307ee21..f184a1ce 100644 --- a/src/date/today/index.ts +++ b/src/date/today/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface DateConstructor { diff --git a/src/date/today/method.ts b/src/date/today/method.ts index 9f2c0697..0b313ac4 100644 --- a/src/date/today/method.ts +++ b/src/date/today/method.ts @@ -1,9 +1,13 @@ -import * as pad from "../../string/pad/method"; +import pad from "../../string/pad/method"; const method = () => { const now = new Date(); - return `${now.getFullYear()}-${pad(`${now.getMonth() + 1}`, -2, "0")}-${pad(`${now.getDate()}`, -2, "0")}`; + return `${now.getFullYear()}-${pad(`${now.getMonth() + 1}`, -2, "0")}-${pad( + `${now.getDate()}`, + -2, + "0", + )}`; }; export = method; diff --git a/src/date/today/test.ts b/src/date/today/test.ts index b7a5aff5..873a163b 100644 --- a/src/date/today/test.ts +++ b/src/date/today/test.ts @@ -1,11 +1,16 @@ -import "./index"; -import * as pad from "../../string/pad/method"; +import "."; +import pad from "../../string/pad/method"; describe("Date.today", () => { test("Date.today() returns today's date", () => { const now = new Date(); - expect(Date.today()) - .toEqual(`${now.getFullYear()}-${pad(`${now.getMonth() + 1}`, -2, "0")}-${pad(`${now.getDate()}`, -2, "0")}`); + expect(Date.today()).toEqual( + `${now.getFullYear()}-${pad(`${now.getMonth() + 1}`, -2, "0")}-${pad( + `${now.getDate()}`, + -2, + "0", + )}`, + ); }); }); diff --git a/src/date/tomorrow/index.ts b/src/date/tomorrow/index.ts index ca90bb2c..1f45b3c4 100644 --- a/src/date/tomorrow/index.ts +++ b/src/date/tomorrow/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface DateConstructor { diff --git a/src/date/tomorrow/method.ts b/src/date/tomorrow/method.ts index 344a4825..5b39a380 100644 --- a/src/date/tomorrow/method.ts +++ b/src/date/tomorrow/method.ts @@ -1,11 +1,15 @@ -import * as pad from "../../string/pad/method"; +import pad from "../../string/pad/method"; const method = () => { const now = new Date(); now.setDate(now.getDate() + 1); - return `${now.getFullYear()}-${pad(`${now.getMonth() + 1}`, -2, "0")}-${pad(`${now.getDate()}`, -2, "0")}`; + return `${now.getFullYear()}-${pad(`${now.getMonth() + 1}`, -2, "0")}-${pad( + `${now.getDate()}`, + -2, + "0", + )}`; }; export = method; diff --git a/src/date/tomorrow/test.ts b/src/date/tomorrow/test.ts index 4b789ac0..8efe1c7a 100644 --- a/src/date/tomorrow/test.ts +++ b/src/date/tomorrow/test.ts @@ -1,19 +1,22 @@ -import "./index"; -import * as pad from "../../string/pad/method"; +import "."; +import pad from "../../string/pad/method"; describe("Date.tomorrow", () => { test("Date.tomorrow() returns tomorrow's date", () => { const now = new Date(); - const tomorrow = new Date(now.getFullYear(), now.getMonth(), now.getDate() + 1); + const tomorrow = new Date( + now.getFullYear(), + now.getMonth(), + now.getDate() + 1, + ); - expect(Date.tomorrow()) - .toEqual(`${ - tomorrow.getFullYear() - }-${ - pad(`${tomorrow.getMonth() + 1}`, -2, "0") - }-${ - pad(`${tomorrow.getDate()}`, -2, "0") - }`); + expect(Date.tomorrow()).toEqual( + `${tomorrow.getFullYear()}-${pad( + `${tomorrow.getMonth() + 1}`, + -2, + "0", + )}-${pad(`${tomorrow.getDate()}`, -2, "0")}`, + ); }); }); diff --git a/src/date/yesterday/index.ts b/src/date/yesterday/index.ts index 142ccd6b..137211e9 100644 --- a/src/date/yesterday/index.ts +++ b/src/date/yesterday/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface DateConstructor { diff --git a/src/date/yesterday/method.ts b/src/date/yesterday/method.ts index 6f8b1f91..d69438c0 100644 --- a/src/date/yesterday/method.ts +++ b/src/date/yesterday/method.ts @@ -1,11 +1,15 @@ -import * as pad from "../../string/pad/method"; +import pad from "../../string/pad/method"; const method = () => { const now = new Date(); now.setDate(now.getDate() - 1); - return `${now.getFullYear()}-${pad(`${now.getMonth() + 1}`, -2, "0")}-${pad(`${now.getDate()}`, -2, "0")}`; + return `${now.getFullYear()}-${pad(`${now.getMonth() + 1}`, -2, "0")}-${pad( + `${now.getDate()}`, + -2, + "0", + )}`; }; export = method; diff --git a/src/date/yesterday/test.ts b/src/date/yesterday/test.ts index c1d381b7..c8c9de7a 100644 --- a/src/date/yesterday/test.ts +++ b/src/date/yesterday/test.ts @@ -1,19 +1,22 @@ -import "./index"; -import * as pad from "../../string/pad/method"; +import "."; +import pad from "../../string/pad/method"; describe("Date.yesterday", () => { test("Date.yesterday() returns yesterday's date", () => { const now = new Date(); - const yesterday = new Date(now.getFullYear(), now.getMonth(), now.getDate() - 1); + const yesterday = new Date( + now.getFullYear(), + now.getMonth(), + now.getDate() - 1, + ); - expect(Date.yesterday()) - .toEqual(`${ - yesterday.getFullYear() - }-${ - pad(`${yesterday.getMonth() + 1}`, -2, "0") - }-${ - pad(`${yesterday.getDate()}`, -2, "0") - }`); + expect(Date.yesterday()).toEqual( + `${yesterday.getFullYear()}-${pad( + `${yesterday.getMonth() + 1}`, + -2, + "0", + )}-${pad(`${yesterday.getDate()}`, -2, "0")}`, + ); }); }); diff --git a/src/function/cache/index.ts b/src/function/cache/index.ts index b330f9c4..df265641 100644 --- a/src/function/cache/index.ts +++ b/src/function/cache/index.ts @@ -1,4 +1,5 @@ -import * as method from "./method"; +import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Function { @@ -18,6 +19,6 @@ declare global { * test.cache(); // takes a second to log 'test' * test.cache(); // instantly logs the second 'test' */ -Function.prototype.cache = function(...args) { +Function.prototype.cache = function cache(...args) { return method(this)(...args); }; diff --git a/src/function/cache/method.ts b/src/function/cache/method.ts index 6240c691..3a31dbcf 100644 --- a/src/function/cache/method.ts +++ b/src/function/cache/method.ts @@ -5,7 +5,9 @@ const method = (func: Function): any => { const cached = (...args: any[]) => { const key = JSON.stringify(args); - return cache.has(key) ? cache.get(key) : cache.set(key, func.call(func, ...args)) && cache.get(key); + return cache.has(key) + ? cache.get(key) + : cache.set(key, func.call(func, ...args)) && cache.get(key); }; func.cached = cache; diff --git a/src/function/cache/test.ts b/src/function/cache/test.ts index 9da0b089..983dd5f9 100644 --- a/src/function/cache/test.ts +++ b/src/function/cache/test.ts @@ -1,13 +1,11 @@ -import "./index"; +import "."; describe("Function.prototype.cache", () => { test("Math.max.cache(1, 22, 15) returns 22", () => { - expect(Math.max.cache(1, 22, 15)) - .toBe(22); + expect(Math.max.cache(1, 22, 15)).toBe(22); }); test("Math.max.cache(1, 22, 15) returns 22", () => { - expect(Math.max.cache(1, 22, 15)) - .toBe(22); + expect(Math.max.cache(1, 22, 15)).toBe(22); }); }); diff --git a/src/function/defer/index.ts b/src/function/defer/index.ts index 120b9d1c..47254509 100644 --- a/src/function/defer/index.ts +++ b/src/function/defer/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Function { diff --git a/src/function/defer/method.ts b/src/function/defer/method.ts index 357fb037..74922c41 100644 --- a/src/function/defer/method.ts +++ b/src/function/defer/method.ts @@ -1,4 +1,5 @@ // tslint:disable-next-line:ban-types -const method = (func: Function, ...args: any[]): any => setTimeout(func, 1, ...args); +const method = (func: Function, ...args: any[]): any => + setTimeout(func, 1, ...args); export = method; diff --git a/src/function/isFunction/index.ts b/src/function/isFunction/index.ts index 683c8a10..73d577c4 100644 --- a/src/function/isFunction/index.ts +++ b/src/function/isFunction/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface FunctionConstructor { diff --git a/src/function/isFunction/test.ts b/src/function/isFunction/test.ts index 310c29d6..50079256 100644 --- a/src/function/isFunction/test.ts +++ b/src/function/isFunction/test.ts @@ -1,13 +1,11 @@ -import "./index"; +import "."; describe("Function.isFunction", () => { test("Function.isFunction(2) returns false", () => { - expect(Function.isFunction(2)) - .toBe(false); + expect(Function.isFunction(2)).toBe(false); }); test("Function.isFunction((() => {})) returns true", () => { - expect(Function.isFunction((() => {}))) - .toBe(true); + expect(Function.isFunction(() => {})).toBe(true); }); }); diff --git a/src/function/methods.ts b/src/function/methods.ts index 3ccbab85..4890484f 100644 --- a/src/function/methods.ts +++ b/src/function/methods.ts @@ -1,11 +1,6 @@ -import * as cache from "./cache/method"; -import * as defer from "./defer/method"; -import * as isFunction from "./isFunction/method"; -import * as once from "./once/method"; +import cache from "./cache/method"; +import defer from "./defer/method"; +import isFunction from "./isFunction/method"; +import once from "./once/method"; -export { - cache, - defer, - isFunction, - once, -}; +export { cache, defer, isFunction, once }; diff --git a/src/function/once/index.ts b/src/function/once/index.ts index 77124d6c..03ec2ea4 100644 --- a/src/function/once/index.ts +++ b/src/function/once/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Function { diff --git a/src/globals/isBrowser/index.ts b/src/globals/isBrowser/index.ts index 193b9ff9..1fee4a12 100644 --- a/src/globals/isBrowser/index.ts +++ b/src/globals/isBrowser/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { namespace NodeJS { diff --git a/src/globals/isBrowser/method.ts b/src/globals/isBrowser/method.ts index eaa231b6..e823b109 100644 --- a/src/globals/isBrowser/method.ts +++ b/src/globals/isBrowser/method.ts @@ -1,4 +1,4 @@ -import * as contains from "../../array/contains/method"; +import contains from "../../array/contains/method"; const method = () => !contains([typeof window, typeof document], "undefined"); diff --git a/src/globals/isBrowser/test.ts b/src/globals/isBrowser/test.ts index 356e6b3e..e3abc4f9 100644 --- a/src/globals/isBrowser/test.ts +++ b/src/globals/isBrowser/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; beforeAll(() => { // Jest creates virtual ones ! diff --git a/src/globals/methods.ts b/src/globals/methods.ts index 6fb1c288..8678cd2f 100644 --- a/src/globals/methods.ts +++ b/src/globals/methods.ts @@ -1,5 +1,3 @@ -import * as isBrowser from "./isBrowser/method"; +import isBrowser from "./isBrowser/method"; -export { - isBrowser, -}; +export { isBrowser }; diff --git a/src/math/average/index.ts b/src/math/average/index.ts index 33a332a3..ebc08396 100644 --- a/src/math/average/index.ts +++ b/src/math/average/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface Math { diff --git a/src/math/average/method.ts b/src/math/average/method.ts index b04d96ad..29125aa7 100644 --- a/src/math/average/method.ts +++ b/src/math/average/method.ts @@ -1,4 +1,4 @@ -import * as sum from "../../array/sum/method"; +import sum from "../../array/sum/method"; const method = (...nums: number[]): number => sum(nums) / nums.length; diff --git a/src/math/average/test.ts b/src/math/average/test.ts index 7a75a70a..784b0f90 100644 --- a/src/math/average/test.ts +++ b/src/math/average/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("Math.average", () => { test("Math.average(1, 2, 3) returns 2", () => { - expect(Math.average(1, 2, 3)) - .toBe(2); + expect(Math.average(1, 2, 3)).toBe(2); }); }); diff --git a/src/math/degreesToRads/index.ts b/src/math/degreesToRads/index.ts index db8eddda..19aa2344 100644 --- a/src/math/degreesToRads/index.ts +++ b/src/math/degreesToRads/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface Math { diff --git a/src/math/degreesToRads/test.ts b/src/math/degreesToRads/test.ts index df695019..b4551955 100644 --- a/src/math/degreesToRads/test.ts +++ b/src/math/degreesToRads/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("Math.degreesToRads", () => { test("Math.degreesToRads(180) returns 3.141592653589793", () => { - expect(Math.degreesToRads(180)) - .toBe(3.141592653589793); + expect(Math.degreesToRads(180)).toBe(3.141592653589793); }); }); diff --git a/src/math/factorial/index.ts b/src/math/factorial/index.ts index a5658f1f..741ea09b 100644 --- a/src/math/factorial/index.ts +++ b/src/math/factorial/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface Math { diff --git a/src/math/factorial/method.ts b/src/math/factorial/method.ts index 9ecabc72..9aed2361 100644 --- a/src/math/factorial/method.ts +++ b/src/math/factorial/method.ts @@ -1,3 +1,3 @@ -const method = (n: number): number => n <= 1 ? 1 : n * Math.factorial(n - 1); +const method = (n: number): number => (n <= 1 ? 1 : n * Math.factorial(n - 1)); export = method; diff --git a/src/math/factorial/test.ts b/src/math/factorial/test.ts index 229aaf29..c7b044bf 100644 --- a/src/math/factorial/test.ts +++ b/src/math/factorial/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("Math.factorial", () => { test("Math.factorial(6) returns 720", () => { - expect(Math.factorial(6)) - .toBe(720); + expect(Math.factorial(6)).toBe(720); }); }); diff --git a/src/math/fibonacci/index.ts b/src/math/fibonacci/index.ts index 2b2485d3..5bcbd787 100644 --- a/src/math/fibonacci/index.ts +++ b/src/math/fibonacci/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface Math { diff --git a/src/math/fibonacci/method.ts b/src/math/fibonacci/method.ts index 503f55e0..fb3f9b52 100644 --- a/src/math/fibonacci/method.ts +++ b/src/math/fibonacci/method.ts @@ -1,6 +1,8 @@ -const method = (nth: number): number[] => Array.from({ length: nth }).reduce( - (prev: any, value, index) => prev.concat(index > 1 ? prev[index - 1] + prev[index - 2] : index), - [] -); +const method = (nth: number): number[] => + Array.from({ length: nth }).reduce( + (prev: any, value, index) => + prev.concat(index > 1 ? prev[index - 1] + prev[index - 2] : index), + [], + ) as any; export = method; diff --git a/src/math/fibonacci/test.ts b/src/math/fibonacci/test.ts index b1e09d67..447bbd93 100644 --- a/src/math/fibonacci/test.ts +++ b/src/math/fibonacci/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("Math.fibonacci", () => { test("Math.fibonacci(6) returns [0, 1, 1, 2, 3, 5]", () => { - expect(Math.fibonacci(6)) - .toEqual([0, 1, 1, 2, 3, 5]); + expect(Math.fibonacci(6)).toEqual([0, 1, 1, 2, 3, 5]); }); }); diff --git a/src/math/gcd/index.ts b/src/math/gcd/index.ts index b88876aa..5297ddff 100644 --- a/src/math/gcd/index.ts +++ b/src/math/gcd/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface Math { diff --git a/src/math/gcd/test.ts b/src/math/gcd/test.ts index 8f04d547..bb3b1a9c 100644 --- a/src/math/gcd/test.ts +++ b/src/math/gcd/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("Math.gcd", () => { test("Math.gcd(...[12, 8, 32]) returns 4", () => { - expect(Math.gcd(...[12, 8, 32])) - .toBe(4); + expect(Math.gcd(...[12, 8, 32])).toBe(4); }); }); diff --git a/src/math/isDivisible/index.ts b/src/math/isDivisible/index.ts index 21ab7eed..662aee96 100644 --- a/src/math/isDivisible/index.ts +++ b/src/math/isDivisible/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface Math { diff --git a/src/math/isDivisible/test.ts b/src/math/isDivisible/test.ts index 55b20aad..1a2a5845 100644 --- a/src/math/isDivisible/test.ts +++ b/src/math/isDivisible/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("Math.isDivisible", () => { test("Math.isDivisible(6, 3) returns true", () => { - expect(Math.isDivisible(6, 3)) - .toBe(true); + expect(Math.isDivisible(6, 3)).toBe(true); }); }); diff --git a/src/math/isEven/index.ts b/src/math/isEven/index.ts index 871c9dd5..a22b0f8a 100644 --- a/src/math/isEven/index.ts +++ b/src/math/isEven/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface Math { diff --git a/src/math/isEven/test.ts b/src/math/isEven/test.ts index 08b21cf5..00c1a5f1 100644 --- a/src/math/isEven/test.ts +++ b/src/math/isEven/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("Math.isEven", () => { test("Math.isEven(3) returns false", () => { - expect(Math.isEven(3)) - .toBe(false); + expect(Math.isEven(3)).toBe(false); }); }); diff --git a/src/math/isPrime/index.ts b/src/math/isPrime/index.ts index 7f1a73a1..176e56c6 100644 --- a/src/math/isPrime/index.ts +++ b/src/math/isPrime/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface Math { diff --git a/src/math/isPrime/test.ts b/src/math/isPrime/test.ts index d681ce8c..4c47f436 100644 --- a/src/math/isPrime/test.ts +++ b/src/math/isPrime/test.ts @@ -1,13 +1,11 @@ -import "./index"; +import "."; describe("Math.isPrime", () => { test("Math.isPrime(4) returns false", () => { - expect(Math.isPrime(4)) - .toBe(false); + expect(Math.isPrime(4)).toBe(false); }); test("Math.isPrime(11) returns true", () => { - expect(Math.isPrime(11)) - .toBe(true); + expect(Math.isPrime(11)).toBe(true); }); }); diff --git a/src/math/lcm/index.ts b/src/math/lcm/index.ts index 511c4b51..f3f56b64 100644 --- a/src/math/lcm/index.ts +++ b/src/math/lcm/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface Math { diff --git a/src/math/lcm/method.ts b/src/math/lcm/method.ts index 4b82628d..c47ce3e3 100644 --- a/src/math/lcm/method.ts +++ b/src/math/lcm/method.ts @@ -1,7 +1,8 @@ const method = (...nums: number[]): number => { - const gcd: (x: number, y: number) => number = (x, y) => (!y ? x : gcd(y, x % y)); + const gcd: (x: number, y: number) => number = (x, y) => + !y ? x : gcd(y, x % y); - const lcm: (x: number, y: number) => number = (x, y) => x * y / gcd(x, y); + const lcm: (x: number, y: number) => number = (x, y) => (x * y) / gcd(x, y); return nums.reduce((a, b) => lcm(a, b)); }; diff --git a/src/math/lcm/test.ts b/src/math/lcm/test.ts index 02b8fca4..c7d1b6d7 100644 --- a/src/math/lcm/test.ts +++ b/src/math/lcm/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("Math.lcm", () => { test("Math.lcm(12, 7) returns 84", () => { - expect(Math.lcm(12, 7)) - .toBe(84); + expect(Math.lcm(12, 7)).toBe(84); }); }); diff --git a/src/math/methods.ts b/src/math/methods.ts index 12bea862..1449851c 100644 --- a/src/math/methods.ts +++ b/src/math/methods.ts @@ -1,14 +1,14 @@ -import * as average from "./average/method"; -import * as degreesToRads from "./degreesToRads/method"; -import * as factorial from "./factorial/method"; -import * as fibonacci from "./fibonacci/method"; -import * as gcd from "./gcd/method"; -import * as isDivisible from "./isDivisible/method"; -import * as isEven from "./isEven/method"; -import * as isPrime from "./isPrime/method"; -import * as lcm from "./lcm/method"; -import * as primes from "./primes/method"; -import * as radsToDegrees from "./radsToDegrees/method"; +import average from "./average/method"; +import degreesToRads from "./degreesToRads/method"; +import factorial from "./factorial/method"; +import fibonacci from "./fibonacci/method"; +import gcd from "./gcd/method"; +import isDivisible from "./isDivisible/method"; +import isEven from "./isEven/method"; +import isPrime from "./isPrime/method"; +import lcm from "./lcm/method"; +import primes from "./primes/method"; +import radsToDegrees from "./radsToDegrees/method"; export { average, diff --git a/src/math/primes/index.ts b/src/math/primes/index.ts index db48fbd8..9b16fcee 100644 --- a/src/math/primes/index.ts +++ b/src/math/primes/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface Math { diff --git a/src/math/primes/method.ts b/src/math/primes/method.ts index c759dd63..52add12a 100644 --- a/src/math/primes/method.ts +++ b/src/math/primes/method.ts @@ -1,10 +1,11 @@ -import * as range from "../../array/range/method"; +import range from "../../array/range/method"; const method = (num: number): number[] => { let arr = range(num, 2); - range(Math.floor(Math.sqrt(num)), 2) - .forEach((x) => arr = arr.filter((y) => y % x !== 0 || y === x)); + range(Math.floor(Math.sqrt(num)), 2).forEach( + x => (arr = arr.filter(y => y % x !== 0 || y === x)), + ); return arr; }; diff --git a/src/math/primes/test.ts b/src/math/primes/test.ts index d9ef57ab..835c2f5b 100644 --- a/src/math/primes/test.ts +++ b/src/math/primes/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("Math.primes", () => { test("Math.primes(10) returns [2, 3, 5, 7]", () => { - expect(Math.primes(10)) - .toEqual([2, 3, 5, 7]); + expect(Math.primes(10)).toEqual([2, 3, 5, 7]); }); }); diff --git a/src/math/radsToDegrees/index.ts b/src/math/radsToDegrees/index.ts index c33305d3..4a5c17bf 100644 --- a/src/math/radsToDegrees/index.ts +++ b/src/math/radsToDegrees/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface Math { diff --git a/src/math/radsToDegrees/test.ts b/src/math/radsToDegrees/test.ts index 7d640b2c..0bd3ca5a 100644 --- a/src/math/radsToDegrees/test.ts +++ b/src/math/radsToDegrees/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("Math.radsToDegrees", () => { test("Math.radsToDegrees(Math.PI / 2) returns 90", () => { - expect(Math.radsToDegrees(Math.PI / 2)) - .toBe(90); + expect(Math.radsToDegrees(Math.PI / 2)).toBe(90); }); }); diff --git a/src/methods.ts b/src/methods.ts index c07a9e8d..674eb5b1 100644 --- a/src/methods.ts +++ b/src/methods.ts @@ -8,14 +8,4 @@ import * as number from "./number/methods"; import * as object from "./object/methods"; import * as string from "./string/methods"; -export { - array, - boolean, - date, - func as function, - globals, - math, - number, - object, - string, -}; +export { array, boolean, date, func, globals, math, number, object, string }; diff --git a/src/number/digitize/index.ts b/src/number/digitize/index.ts index 30200e63..10b15146 100644 --- a/src/number/digitize/index.ts +++ b/src/number/digitize/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Number { diff --git a/src/number/digitize/method.ts b/src/number/digitize/method.ts index 8747eb56..b95ede23 100644 --- a/src/number/digitize/method.ts +++ b/src/number/digitize/method.ts @@ -1,3 +1,3 @@ -const method = (num: number): number[] => [...`${num}`].map((n) => +n); +const method = (num: number): number[] => [...`${num}`].map(n => +n); export = method; diff --git a/src/number/digitize/test.ts b/src/number/digitize/test.ts index 67e94864..966490cc 100644 --- a/src/number/digitize/test.ts +++ b/src/number/digitize/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Number.prototype.digitize", () => { test("(123).digitize() returns [1, 2, 3]", () => { diff --git a/src/number/equals/index.ts b/src/number/equals/index.ts index 30ad6166..e63b636c 100644 --- a/src/number/equals/index.ts +++ b/src/number/equals/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Number { diff --git a/src/number/equals/test.ts b/src/number/equals/test.ts index a4f28918..e5ce17ab 100644 --- a/src/number/equals/test.ts +++ b/src/number/equals/test.ts @@ -1,7 +1,7 @@ -import "./index"; +import "."; describe("Number.prototype.equals", () => { - test("(22).equals(\"22\") returns false", () => { + test('(22).equals("22") returns false', () => { expect((22).equals("22")).toBe(false); }); diff --git a/src/number/inRange/index.ts b/src/number/inRange/index.ts index 89897eaf..edb9c557 100644 --- a/src/number/inRange/index.ts +++ b/src/number/inRange/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface Number { diff --git a/src/number/inRange/method.ts b/src/number/inRange/method.ts index c739a52f..9b526514 100644 --- a/src/number/inRange/method.ts +++ b/src/number/inRange/method.ts @@ -1,3 +1,4 @@ -const method = (num: number, end: number, start = 0) => start <= num && num <= end; +const method = (num: number, end: number, start = 0) => + start <= num && num <= end; export = method; diff --git a/src/number/inRange/test.ts b/src/number/inRange/test.ts index 39c7d660..0cc0b287 100644 --- a/src/number/inRange/test.ts +++ b/src/number/inRange/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Number.prototype.inRange", () => { test("(4).inRange(8) returns true", () => { diff --git a/src/number/isNumber/index.ts b/src/number/isNumber/index.ts index bbf0913f..8acf9897 100644 --- a/src/number/isNumber/index.ts +++ b/src/number/isNumber/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface NumberConstructor { diff --git a/src/number/isNumber/method.ts b/src/number/isNumber/method.ts index 6f8bb209..8383cc5c 100644 --- a/src/number/isNumber/method.ts +++ b/src/number/isNumber/method.ts @@ -1,3 +1,4 @@ -const method = (arg: any): arg is number => typeof arg === "number" || arg instanceof Number; +const method = (arg: any): arg is number => + typeof arg === "number" || arg instanceof Number; export = method; diff --git a/src/number/isNumber/test.ts b/src/number/isNumber/test.ts index a9279d31..b2684116 100644 --- a/src/number/isNumber/test.ts +++ b/src/number/isNumber/test.ts @@ -1,24 +1,20 @@ -import "./index"; +import "."; describe("Number.isNumber", () => { - test("Number.isNumber(\"foo bar\") returns false", () => { - expect(Number.isNumber("foo bar")) - .toBe(false); + test('Number.isNumber("foo bar") returns false', () => { + expect(Number.isNumber("foo bar")).toBe(false); }); - test("Number.isNumber(\"2\") returns false", () => { - expect(Number.isNumber("2")) - .toBe(false); + test('Number.isNumber("2") returns false', () => { + expect(Number.isNumber("2")).toBe(false); }); test("Number.isNumber(new Number(2)) returns true", () => { // tslint:disable-next-line - expect(Number.isNumber(new Number(2))) - .toBe(true); + expect(Number.isNumber(new Number(2))).toBe(true); }); test("Number.isNumber(2) returns true", () => { - expect(Number.isNumber(2)) - .toBe(true); + expect(Number.isNumber(2)).toBe(true); }); }); diff --git a/src/number/methods.ts b/src/number/methods.ts index 839b2e05..3d5b8a29 100644 --- a/src/number/methods.ts +++ b/src/number/methods.ts @@ -1,11 +1,6 @@ -import * as digitize from "./digitize/method"; -import * as equals from "./equals/method"; -import * as inRange from "./inRange/method"; -import * as isNumber from "./isNumber/method"; +import digitize from "./digitize/method"; +import equals from "./equals/method"; +import inRange from "./inRange/method"; +import isNumber from "./isNumber/method"; -export { - digitize, - equals, - inRange, - isNumber, -}; +export { digitize, equals, inRange, isNumber }; diff --git a/src/object/assign/index.ts b/src/object/assign/index.ts index 24416ddc..aa2d1bad 100644 --- a/src/object/assign/index.ts +++ b/src/object/assign/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/assign/method.ts b/src/object/assign/method.ts index d6da5c11..627e307b 100644 --- a/src/object/assign/method.ts +++ b/src/object/assign/method.ts @@ -1,3 +1,4 @@ -const method = (obj: object, ...sources: object[]): object => Object.assign(obj, ...sources); +const method = (obj: object, ...sources: object[]): object => + Object.assign(obj, ...sources); export = method; diff --git a/src/object/assign/test.ts b/src/object/assign/test.ts index cde80abd..11198577 100644 --- a/src/object/assign/test.ts +++ b/src/object/assign/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Object.prototype.$assign", () => { test("{ a: 0 }.$assign({ a: 1 }, { b: 2 }) returns { a: 1, b: 2 }", () => { diff --git a/src/object/camelCaseKeys/index.ts b/src/object/camelCaseKeys/index.ts index 816e6139..0ead56cf 100644 --- a/src/object/camelCaseKeys/index.ts +++ b/src/object/camelCaseKeys/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/camelCaseKeys/method.ts b/src/object/camelCaseKeys/method.ts index 9a1b51fa..60fe2043 100644 --- a/src/object/camelCaseKeys/method.ts +++ b/src/object/camelCaseKeys/method.ts @@ -1,10 +1,10 @@ -import * as forEach from "../forEach/method"; -import * as camelCase from "../../string/camelCase/method"; +import camelCase from "../../string/camelCase/method"; +import forEach from "../forEach/method"; const method = (obj: object): object => { const result: { [key: string]: any } = {}; - forEach(obj, (value, key) => result[camelCase(key)] = value); + forEach(obj, (value, key) => (result[camelCase(key)] = value)); return result; }; diff --git a/src/object/camelCaseKeys/test.ts b/src/object/camelCaseKeys/test.ts index 58fd36a4..607325dd 100644 --- a/src/object/camelCaseKeys/test.ts +++ b/src/object/camelCaseKeys/test.ts @@ -1,11 +1,13 @@ -import "./index"; +import "."; describe("Object.prototype.$camelCaseKeys", () => { test( - "{ First_name: \"Adam\", \"last-name\": \"Smith\" }.$camelCaseKeys() returns " + - "{firstName: \"Adam\", lastName: \"Smith\"}", + '{ First_name: "Adam", "last-name": "Smith" }.$camelCaseKeys() returns ' + + '{firstName: "Adam", lastName: "Smith"}', () => { - expect({ "First_name": "Adam", "last-name": "Smith" }.$camelCaseKeys()) - .toEqual({ firstName: "Adam", lastName: "Smith" }); - }); + expect( + { First_name: "Adam", "last-name": "Smith" }.$camelCaseKeys(), + ).toEqual({ firstName: "Adam", lastName: "Smith" }); + }, + ); }); diff --git a/src/object/clone/index.ts b/src/object/clone/index.ts index bd765101..7d1e7a4e 100644 --- a/src/object/clone/index.ts +++ b/src/object/clone/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/clone/method.ts b/src/object/clone/method.ts index 9153981b..21d6db09 100644 --- a/src/object/clone/method.ts +++ b/src/object/clone/method.ts @@ -1,7 +1,6 @@ import { deepClone } from "../../utils"; -const method = (obj: object, deep: boolean = false): object => deep ? - deepClone(obj) : - Object.assign({}, obj); +const method = (obj: object, deep: boolean = false): object => + deep ? deepClone(obj) : Object.assign({}, obj); export = method; diff --git a/src/object/clone/test.ts b/src/object/clone/test.ts index 800782e9..2f229fa7 100644 --- a/src/object/clone/test.ts +++ b/src/object/clone/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Object.prototype.$clone", () => { test("{ foo: 'bar', obj: { a: 1, b: 2 } }.$clone()", () => { diff --git a/src/object/defaults/index.ts b/src/object/defaults/index.ts index 6c3610cd..2fc860cd 100644 --- a/src/object/defaults/index.ts +++ b/src/object/defaults/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/defaults/method.ts b/src/object/defaults/method.ts index 63bbb16a..c5aa02ab 100644 --- a/src/object/defaults/method.ts +++ b/src/object/defaults/method.ts @@ -1,4 +1,4 @@ -// @ts-ignore -const method = (obj: object, ...sources: object[]): object => Object.assign(...sources.reverse(), obj); +const method = (obj: object, ...sources: object[]): object => + Object.assign(sources.pop()!, ...sources.reverse(), obj); export = method; diff --git a/src/object/defaults/test.ts b/src/object/defaults/test.ts index 7677cf9f..23a695b5 100644 --- a/src/object/defaults/test.ts +++ b/src/object/defaults/test.ts @@ -1,7 +1,10 @@ -import "./index"; +import "."; describe("Object.prototype.$defaults", () => { test("{ a: 0 }.$defaults({ a: 1, b: 2 }, { b: 3 }) returns { a: 0, b: 2 }", () => { - expect({ a: 0 }.$defaults({ a: 1, b: 2 }, { b: 3 })).toEqual({ a: 0, b: 2 }); + expect({ a: 0 }.$defaults({ a: 1, b: 2 }, { b: 3 })).toEqual({ + a: 0, + b: 2, + }); }); }); diff --git a/src/object/dig/index.ts b/src/object/dig/index.ts index a0fe67b1..6c533242 100644 --- a/src/object/dig/index.ts +++ b/src/object/dig/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/dig/method.ts b/src/object/dig/method.ts index 918558c6..5215c946 100644 --- a/src/object/dig/method.ts +++ b/src/object/dig/method.ts @@ -1,11 +1,13 @@ -import * as values from "../values/method"; +import values from "../values/method"; -const method = (obj: object, target: string): any => - target in obj - ? (obj as any)[target] - : values(obj).reduce((acc, val) => { - if (acc !== undefined) return acc; - if (typeof val === "object") return method(val, target); - }, undefined); +const method = (obj: object, target: string): any => { + if (target in obj) return (obj as any)[target]; + + return values(obj).reduce((acc, val) => { + if (acc !== undefined) return acc; + if (typeof val === "object") return method(val, target); + // tslint:disable-next-line: align + }, undefined); +}; export = method; diff --git a/src/object/dig/test.ts b/src/object/dig/test.ts index a273c0a5..8b7c07a8 100644 --- a/src/object/dig/test.ts +++ b/src/object/dig/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Object.prototype.$dig", () => { const data = { @@ -10,15 +10,15 @@ describe("Object.prototype.$dig", () => { }, }; - test("data.$dig(\"foo\") returns \"bar\"", () => { + test('data.$dig("foo") returns "bar"', () => { expect(data.$dig("foo")).toBe("bar"); }); - test("data.$dig(\"level3\") returns \"some data\"", () => { + test('data.$dig("level3") returns "some data"', () => { expect(data.$dig("level3")).toBe("some data"); }); - test("data.$dig(\"level4\") returns undefined", () => { + test('data.$dig("level4") returns undefined', () => { expect(data.$dig("level4")).toBe(undefined); }); }); diff --git a/src/object/empty/index.ts b/src/object/empty/index.ts index c31e2031..2590aaea 100644 --- a/src/object/empty/index.ts +++ b/src/object/empty/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/empty/method.ts b/src/object/empty/method.ts index 1eec0882..a6ed49fa 100644 --- a/src/object/empty/method.ts +++ b/src/object/empty/method.ts @@ -1,10 +1,9 @@ -import * as size from "../size/method"; - const method = (obj: object) => { const keys = Object.keys(obj); - for (let i = 0; i < keys.length; i++) + for (let i = 0; i < keys.length; i++) { delete (obj as any)[keys[i]]; + } }; export = method; diff --git a/src/object/empty/test.ts b/src/object/empty/test.ts index 85ce0709..93c4ea55 100644 --- a/src/object/empty/test.ts +++ b/src/object/empty/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Object.prototype.$empty", () => { test("{ a: 1 }.$empty()", () => { diff --git a/src/object/equals/index.ts b/src/object/equals/index.ts index 0d3ab1cf..f5492d13 100644 --- a/src/object/equals/index.ts +++ b/src/object/equals/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/equals/method.ts b/src/object/equals/method.ts index 730439ca..33deea53 100644 --- a/src/object/equals/method.ts +++ b/src/object/equals/method.ts @@ -1,6 +1,6 @@ -import * as isObject from "../isObject/method"; -import * as isDate from "../../date/isDate/method"; -import * as dateEquals from "../../date/equals/method"; +import dateEquals from "../../date/equals/method"; +import isDate from "../../date/isDate/method"; +import isObject from "../isObject/method"; const method = (obj: { [key: string]: any }, obj2: any): boolean => { if (obj === obj2) return true; @@ -15,7 +15,7 @@ const method = (obj: { [key: string]: any }, obj2: any): boolean => { if (keys.length !== Object.keys(obj2).length) return false; - return keys.every((k) => method(obj[k], (obj2 as any)[k])); + return keys.every(k => method(obj[k], (obj2 as any)[k])); }; export = method; diff --git a/src/object/equals/test.ts b/src/object/equals/test.ts index b398d108..0ffdad44 100644 --- a/src/object/equals/test.ts +++ b/src/object/equals/test.ts @@ -1,14 +1,21 @@ -import "./index"; +import "."; describe("Object.prototype.$equals", () => { + // tslint:disable-next-line: max-line-length test("{ a: [2, { e: 3 }], b: [4], c: 'foo' }.$equals({ a: [2, { e: 3 }], b: [4], c: 'foo' }) returns true", () => { - expect({ a: [2, { e: 3 }], b: [4], c: "foo" }.$equals({ a: [2, { e: 3 }], b: [4], c: "foo" })) - .toBe(true); + expect( + { a: [2, { e: 3 }], b: [4], c: "foo" }.$equals({ + a: [2, { e: 3 }], + b: [4], + c: "foo", + }), + ).toBe(true); }); test("{ a: [2, { e: 3 }], b: [4], c: 'foo' }.$equals(new Date()) returns false", () => { - expect({ a: [2, { e: 3 }], b: [4], c: "foo" }.$equals(new Date())) - .toBe(false); + expect({ a: [2, { e: 3 }], b: [4], c: "foo" }.$equals(new Date())).toBe( + false, + ); }); test("date.$equals({ a: 1 }) returns false", () => { diff --git a/src/object/flatten/index.ts b/src/object/flatten/index.ts index 78d8f31a..aba71b18 100644 --- a/src/object/flatten/index.ts +++ b/src/object/flatten/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/flatten/method.ts b/src/object/flatten/method.ts index 739a7cbc..592e1d31 100644 --- a/src/object/flatten/method.ts +++ b/src/object/flatten/method.ts @@ -1,5 +1,5 @@ -import * as isPlainObject from "../isPlainObject/method"; -import * as forEach from "../forEach/method"; +import forEach from "../forEach/method"; +import isPlainObject from "../isPlainObject/method"; const method = (obj: { [key: string]: any }): { [key: string]: any } => { const result: { [key: string]: any } = {}; @@ -18,7 +18,7 @@ const method = (obj: { [key: string]: any }): { [key: string]: any } => { if (isPlainObject(value)) { const flat = method(value); - forEach(flat, (subValue, subKey) => { + forEach(flat, (subValue, subKey: string) => { const separator = /^\[/.test(subKey) ? "" : "."; result[`${key}${separator}${subKey}`] = subValue; diff --git a/src/object/flatten/test.ts b/src/object/flatten/test.ts index 1d875042..49800da7 100644 --- a/src/object/flatten/test.ts +++ b/src/object/flatten/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Object.prototype.$flatten", () => { test("1", () => { @@ -19,9 +19,7 @@ describe("Object.prototype.$flatten", () => { [2], ], object: { - array: [ - { number: 3 }, - ], + array: [{ number: 3 }], }, date: new Date(), buffer: Buffer.alloc(2), @@ -29,15 +27,15 @@ describe("Object.prototype.$flatten", () => { }; expect(obj.$flatten()).toEqual({ - "string": "foo", - "number": 1, + string: "foo", + number: 1, "array[0]": "one", "array[1].string": "two", "array[2][0]": 2, "object.array[0].number": 3, - "date": obj.date, - "buffer": obj.buffer, - "class": obj.class, + date: obj.date, + buffer: obj.buffer, + class: obj.class, }); }); }); diff --git a/src/object/forEach/index.ts b/src/object/forEach/index.ts index cfdffab3..0b19d474 100644 --- a/src/object/forEach/index.ts +++ b/src/object/forEach/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/forEach/method.ts b/src/object/forEach/method.ts index 8669b140..a70b70f9 100644 --- a/src/object/forEach/method.ts +++ b/src/object/forEach/method.ts @@ -1,4 +1,9 @@ -const method = (obj: object, fn: (value: any, key: string, object: object) => void) => - Object.keys(obj).forEach((key) => fn((obj as { [key: string]: any })[key], key, obj)); +const method = ( + obj: T, + fn: (value: T[K], key: K, object: T) => void, +) => + Object.keys(obj).forEach(key => + fn((obj as { [key: string]: any })[key], key as K, obj), + ); export = method; diff --git a/src/object/forEach/test.ts b/src/object/forEach/test.ts index cf950c14..9b8721d9 100644 --- a/src/object/forEach/test.ts +++ b/src/object/forEach/test.ts @@ -1,15 +1,20 @@ -import "./index"; +import "."; describe("Object.prototype.$forEach", () => { test( - "{fred: { user: \"fred\", age: 40 }, pebbles: { user: \"pebbles\", age: 1 }}.$forEach(u => u.age) returns " + - "{ fred: 40, pebbles: 1 }", + // tslint:disable-next-line: max-line-length + '{fred: { user: "fred", age: 40 }, pebbles: { user: "pebbles", age: 1 }}.$forEach(u => u.age) returns ' + + "{ fred: 40, pebbles: 1 }", () => { - const obj = { fred: { user: "fred", age: 40 }, pebbles: { user: "pebbles", age: 1 } }; + const obj = { + fred: { user: "fred", age: 40 }, + pebbles: { user: "pebbles", age: 1 }, + }; const result: any = {}; - obj.$forEach((u, k) => result[k] = u.age); + obj.$forEach((u, k) => (result[k] = u.age)); expect(result).toEqual({ fred: 40, pebbles: 1 }); - }); + }, + ); }); diff --git a/src/object/get/index.ts b/src/object/get/index.ts index 13ca47a6..7883f24d 100644 --- a/src/object/get/index.ts +++ b/src/object/get/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/get/method.ts b/src/object/get/method.ts index 14f4c529..f813aa46 100644 --- a/src/object/get/method.ts +++ b/src/object/get/method.ts @@ -1,6 +1,6 @@ import { pathToKeys } from "../../utils"; -const method = (obj: { [key: string]: any }, key: string): any => pathToKeys(key) - .reduce((prev, cur) => prev[cur], obj); +const method = (obj: { [key: string]: any }, key: string): any => + pathToKeys(key).reduce((prev, cur) => prev[cur], obj); export = method; diff --git a/src/object/get/test.ts b/src/object/get/test.ts index 7b91dc5b..ca95a9f4 100644 --- a/src/object/get/test.ts +++ b/src/object/get/test.ts @@ -1,8 +1,10 @@ -import "./index"; +import "."; describe("Object.prototype.$get", () => { + // tslint:disable-next-line: max-line-length test("{ selector: { to: { val: 'val to select' } } }.$get('selector.to.val') returns 'val to select'", () => { - expect({ selector: { to: { val: "val to select" } } }.$get("selector.to.val")) - .toBe("val to select"); + expect( + { selector: { to: { val: "val to select" } } }.$get("selector.to.val"), + ).toBe("val to select"); }); }); diff --git a/src/object/invert/index.ts b/src/object/invert/index.ts index 3972e862..3d622fe6 100644 --- a/src/object/invert/index.ts +++ b/src/object/invert/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/invert/method.ts b/src/object/invert/method.ts index 33b71b7b..101cf2b2 100644 --- a/src/object/invert/method.ts +++ b/src/object/invert/method.ts @@ -3,6 +3,7 @@ const method = (obj: { [key: string]: any }): object => { acc[obj[key]] = key; return acc; + // tslint:disable-next-line: align }, {}); }; diff --git a/src/object/invert/test.ts b/src/object/invert/test.ts index b69624fb..304853c2 100644 --- a/src/object/invert/test.ts +++ b/src/object/invert/test.ts @@ -1,8 +1,10 @@ -import "./index"; +import "."; describe("Object.prototype.$invert", () => { - test("{ name: \"John\", age: 20 }.$invert() returns { 20: \"age\", John: \"name\" }", () => { - expect({ name: "John", age: 20 }.$invert()) - .toEqual({ 20: "age", John: "name" }); + test('{ name: "John", age: 20 }.$invert() returns { 20: "age", John: "name" }', () => { + expect({ name: "John", age: 20 }.$invert()).toEqual({ + 20: "age", + John: "name", + }); }); }); diff --git a/src/object/isEmpty/index.ts b/src/object/isEmpty/index.ts index 1c1d5699..7c729dc6 100644 --- a/src/object/isEmpty/index.ts +++ b/src/object/isEmpty/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/isEmpty/method.ts b/src/object/isEmpty/method.ts index 1b0c43a5..d49cada3 100644 --- a/src/object/isEmpty/method.ts +++ b/src/object/isEmpty/method.ts @@ -1,4 +1,4 @@ -import * as size from "../size/method"; +import size from "../size/method"; const method = (obj: object) => size(obj) === 0; diff --git a/src/object/isEmpty/test.ts b/src/object/isEmpty/test.ts index 50385a3f..4827d33f 100644 --- a/src/object/isEmpty/test.ts +++ b/src/object/isEmpty/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Object.prototype.$isEmpty", () => { test("{ a: 1 }.$isEmpty() returns false", () => { diff --git a/src/object/isObject/index.ts b/src/object/isObject/index.ts index 7121bdb7..eb8584f2 100644 --- a/src/object/isObject/index.ts +++ b/src/object/isObject/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface ObjectConstructor { diff --git a/src/object/isObject/test.ts b/src/object/isObject/test.ts index d5d1d435..231dac5d 100644 --- a/src/object/isObject/test.ts +++ b/src/object/isObject/test.ts @@ -1,12 +1,12 @@ -import "./index"; +import "."; describe("Object.isObject", () => { test("Object.isObject(2) returns false", () => { expect(Object.isObject(2)).toBe(false); }); - test("Object.isObject({foo: \"bar\"}) returns true", () => { - expect(Object.isObject({foo: "bar"})).toBe(true); + test('Object.isObject({foo: "bar"}) returns true', () => { + expect(Object.isObject({ foo: "bar" })).toBe(true); }); test("Object.isObject([1, 2]) returns true", () => { diff --git a/src/object/isObjectLike/index.ts b/src/object/isObjectLike/index.ts index 9150e54f..b90142a1 100644 --- a/src/object/isObjectLike/index.ts +++ b/src/object/isObjectLike/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface ObjectConstructor { diff --git a/src/object/isObjectLike/method.ts b/src/object/isObjectLike/method.ts index a88c5d19..bc934b41 100644 --- a/src/object/isObjectLike/method.ts +++ b/src/object/isObjectLike/method.ts @@ -1,4 +1,4 @@ -import * as isObject from "../isObject/method"; +import isObject from "../isObject/method"; const method = (arg: any): arg is object => { if (!isObject(arg)) return false; diff --git a/src/object/isObjectLike/test.ts b/src/object/isObjectLike/test.ts index 1bbee2cb..c19fe85b 100644 --- a/src/object/isObjectLike/test.ts +++ b/src/object/isObjectLike/test.ts @@ -1,12 +1,12 @@ -import "./index"; +import "."; describe("Object.isObjectLike", () => { test("Object.isObjectLike(2) returns false", () => { expect(Object.isObjectLike(2)).toBe(false); }); - test("Object.isObjectLike({foo: \"bar\"}) returns true", () => { - expect(Object.isObjectLike({foo: "bar"})).toBe(true); + test('Object.isObjectLike({foo: "bar"}) returns true', () => { + expect(Object.isObjectLike({ foo: "bar" })).toBe(true); }); test("Object.isObjectLike([1, 2]) returns true", () => { diff --git a/src/object/isPlainObject/index.ts b/src/object/isPlainObject/index.ts index 1b60c35a..d6622c19 100644 --- a/src/object/isPlainObject/index.ts +++ b/src/object/isPlainObject/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface ObjectConstructor { diff --git a/src/object/isPlainObject/method.ts b/src/object/isPlainObject/method.ts index b3ca2e67..8aea7483 100644 --- a/src/object/isPlainObject/method.ts +++ b/src/object/isPlainObject/method.ts @@ -1,12 +1,13 @@ -import * as isObjectLike from "../isObjectLike/method"; +import isObjectLike from "../isObjectLike/method"; const method = (arg: any): arg is object => { if (!isObjectLike(arg)) return false; let proto = arg; - while (Object.getPrototypeOf(proto) !== null) + while (Object.getPrototypeOf(proto) !== null) { proto = Object.getPrototypeOf(proto); + } return Object.getPrototypeOf(arg) === proto; }; diff --git a/src/object/isPlainObject/test.ts b/src/object/isPlainObject/test.ts index 3252db1c..caea1e6d 100644 --- a/src/object/isPlainObject/test.ts +++ b/src/object/isPlainObject/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; describe("Object.isPlainObject", () => { test("Object.isPlainObject(2) returns false", () => { @@ -7,13 +7,13 @@ describe("Object.isPlainObject", () => { test("Object.isPlainObject(new Foo) returns false", () => { class Foo { - a = 1; + public a = 1; } expect(Object.isPlainObject(new Foo())).toBe(false); }); - test("Object.isPlainObject({foo: \"bar\"}) returns true", () => { + test('Object.isPlainObject({foo: "bar"}) returns true', () => { expect(Object.isPlainObject({ foo: "bar" })).toBe(true); }); diff --git a/src/object/kebabCaseKeys/index.ts b/src/object/kebabCaseKeys/index.ts index 0ac65a44..f42dc446 100644 --- a/src/object/kebabCaseKeys/index.ts +++ b/src/object/kebabCaseKeys/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/kebabCaseKeys/method.ts b/src/object/kebabCaseKeys/method.ts index 4b44ff84..43bda2a4 100644 --- a/src/object/kebabCaseKeys/method.ts +++ b/src/object/kebabCaseKeys/method.ts @@ -1,10 +1,10 @@ -import * as forEach from "../forEach/method"; -import * as kebabCase from "../../string/kebabCase/method"; +import kebabCase from "../../string/kebabCase/method"; +import forEach from "../forEach/method"; const method = (obj: object): object => { const result: { [key: string]: any } = {}; - forEach(obj, (value, key) => result[kebabCase(key)] = value); + forEach(obj, (value, key) => (result[kebabCase(key)] = value)); return result; }; diff --git a/src/object/kebabCaseKeys/test.ts b/src/object/kebabCaseKeys/test.ts index dce2ec65..cb5fa622 100644 --- a/src/object/kebabCaseKeys/test.ts +++ b/src/object/kebabCaseKeys/test.ts @@ -1,11 +1,13 @@ -import "./index"; +import "."; describe("Object.prototype.$kebabCaseKeys", () => { test( - "{ First_name: \"Adam\", lastName: \"Smith\" }.$kebabCaseKeys() returns " + - "{firstName: \"Adam\", lastName: \"Smith\"}", + '{ First_name: "Adam", lastName: "Smith" }.$kebabCaseKeys() returns ' + + '{firstName: "Adam", lastName: "Smith"}', () => { - expect({ First_name: "Adam", lastName: "Smith" }.$kebabCaseKeys()) - .toEqual({ "first-name": "Adam", "last-name": "Smith" }); - }); + expect( + { First_name: "Adam", lastName: "Smith" }.$kebabCaseKeys(), + ).toEqual({ "first-name": "Adam", "last-name": "Smith" }); + }, + ); }); diff --git a/src/object/keys/index.ts b/src/object/keys/index.ts index e0e7495f..65d50b2b 100644 --- a/src/object/keys/index.ts +++ b/src/object/keys/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/keys/method.ts b/src/object/keys/method.ts index 290eadf2..6bd8fa22 100644 --- a/src/object/keys/method.ts +++ b/src/object/keys/method.ts @@ -1,3 +1,3 @@ -const method = (obj: object): string[] => Object.keys(obj); +const method = (obj: T): Array => Object.keys(obj) as any; export = method; diff --git a/src/object/keys/test.ts b/src/object/keys/test.ts index 96d2cec7..6b543d62 100644 --- a/src/object/keys/test.ts +++ b/src/object/keys/test.ts @@ -1,8 +1,11 @@ -import "./index"; +import "."; describe("Object.prototype.$keys", () => { - test("{ one: 1, two: 2, three: 3 }.$keys() returns [\"one\", \"two\", \"three\"]", () => { - expect({ one: 1, two: 2, three: 3 }.$keys()) - .toEqual(["one", "two", "three"]); + test('{ one: 1, two: 2, three: 3 }.$keys() returns ["one", "two", "three"]', () => { + expect({ one: 1, two: 2, three: 3 }.$keys()).toEqual([ + "one", + "two", + "three", + ]); }); }); diff --git a/src/object/lowerCaseKeys/index.ts b/src/object/lowerCaseKeys/index.ts index af1d3356..c9aa6c76 100644 --- a/src/object/lowerCaseKeys/index.ts +++ b/src/object/lowerCaseKeys/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/lowerCaseKeys/method.ts b/src/object/lowerCaseKeys/method.ts index 5d0e01d8..9322642e 100644 --- a/src/object/lowerCaseKeys/method.ts +++ b/src/object/lowerCaseKeys/method.ts @@ -1,9 +1,9 @@ -import * as forEach from "../forEach/method"; +import forEach from "../forEach/method"; const method = (obj: object): object => { const result: { [key: string]: any } = {}; - forEach(obj, (value, key) => result[key.toLowerCase()] = value); + forEach(obj, (value, key: string) => (result[key.toLowerCase()] = value)); return result; }; diff --git a/src/object/lowerCaseKeys/test.ts b/src/object/lowerCaseKeys/test.ts index 435980de..3820f086 100644 --- a/src/object/lowerCaseKeys/test.ts +++ b/src/object/lowerCaseKeys/test.ts @@ -1,8 +1,11 @@ -import "./index"; +import "."; describe("Object.prototype.$lowerCaseKeys", () => { - test("{ Name: \"Adam\", sUrnAME: \"Smith\" }.$lowerCaseKeys() returns {name: \"Adam\", surname: \"Smith\"}", () => { - expect({ Name: "Adam", sUrnAME: "Smith" }.$lowerCaseKeys()) - .toEqual({ name: "Adam", surname: "Smith" }); + // tslint:disable-next-line: max-line-length + test('{ Name: "Adam", sUrnAME: "Smith" }.$lowerCaseKeys() returns {name: "Adam", surname: "Smith"}', () => { + expect({ Name: "Adam", sUrnAME: "Smith" }.$lowerCaseKeys()).toEqual({ + name: "Adam", + surname: "Smith", + }); }); }); diff --git a/src/object/map/index.ts b/src/object/map/index.ts index fd31fde1..09cec641 100644 --- a/src/object/map/index.ts +++ b/src/object/map/index.ts @@ -1,9 +1,11 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { - $map(fn: (value: any, key: string, object: object) => { [key: string]: any }): object; + $map( + fn: (value: any, key: string, object: object) => { [key: string]: any }, + ): object; } } diff --git a/src/object/map/method.ts b/src/object/map/method.ts index da5f0710..c3e4f55a 100644 --- a/src/object/map/method.ts +++ b/src/object/map/method.ts @@ -1,10 +1,18 @@ -import * as forEach from "../forEach/method"; +import forEach from "../forEach/method"; +import keys from "../keys/method"; -const method = (obj: object, fn: (value: any, key: string, object: object) => { [key: string]: any }): object => { - return Object.keys(obj).reduce((prev: { [key: string]: any }, k) => { - forEach(fn((obj as { [key: string]: any })[k], k, obj), (value, key) => prev[key] = value); +const method = ( + obj: T, + fn: (value: T[K], key: K, object: T) => { [key: string]: any }, +): object => { + return keys(obj).reduce((prev: { [key: string]: any }, k) => { + forEach( + fn((obj as any)[k], k as K, obj), + (value, key) => (prev[key] = value), + ); return prev; + // tslint:disable-next-line: align }, {}); }; diff --git a/src/object/map/test.ts b/src/object/map/test.ts index 277154ab..c9568149 100644 --- a/src/object/map/test.ts +++ b/src/object/map/test.ts @@ -1,11 +1,17 @@ -import "./index"; +import "."; describe("Object.prototype.$map", () => { test( - "{fred: { user: \"fred\", age: 40 }, pebbles: { user: \"pebbles\", age: 1 }}.$map(u => u.age) returns " + - "{ fred: 40, pebbles: 1 }", + // tslint:disable-next-line: max-line-length + '{fred: { user: "fred", age: 40 }, pebbles: { user: "pebbles", age: 1 }}.$map(u => u.age) returns ' + + "{ fred: 40, pebbles: 1 }", () => { - expect({ fred: { user: "fred", age: 40 }, pebbles: { user: "pebbles", age: 1 } }.$map((u, k) => ({ [k]: u.age }))) - .toEqual({ fred: 40, pebbles: 1 }); - }); + expect( + { + fred: { user: "fred", age: 40 }, + pebbles: { user: "pebbles", age: 1 }, + }.$map((u, k) => ({ [k]: u.age })), + ).toEqual({ fred: 40, pebbles: 1 }); + }, + ); }); diff --git a/src/object/mapKeys/index.ts b/src/object/mapKeys/index.ts index d2d8c2b6..02780216 100644 --- a/src/object/mapKeys/index.ts +++ b/src/object/mapKeys/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/mapKeys/method.ts b/src/object/mapKeys/method.ts index e657ec2b..9ca304ec 100644 --- a/src/object/mapKeys/method.ts +++ b/src/object/mapKeys/method.ts @@ -1,9 +1,15 @@ -import * as forEach from "../forEach/method"; +import forEach from "../forEach/method"; -const method = (obj: object, fn: (value: any, key: string, object: object) => string): object => { +const method = ( + obj: T, + fn: (value: T[K], key: K, object: T) => string, +): object => { const result: { [key: string]: any } = {}; - forEach(obj, (value, key, object) => result[fn(value, key, object)] = value); + forEach( + obj, + (value, key, object) => (result[fn(value, key, object)] = value), + ); return result; }; diff --git a/src/object/mapKeys/test.ts b/src/object/mapKeys/test.ts index 761033b6..db9c7282 100644 --- a/src/object/mapKeys/test.ts +++ b/src/object/mapKeys/test.ts @@ -1,7 +1,10 @@ -import "./index"; +import "."; describe("Object.prototype.$mapKeys", () => { test("{ a: 1, b: 2 }.$mapKeys((val, key) => key + val) returns { a1: 1, b2: 2 }", () => { - expect({ a: 1, b: 2 }.$mapKeys((val, key) => key + val)).toEqual({ a1: 1, b2: 2 }); + expect({ a: 1, b: 2 }.$mapKeys((val, key) => key + val)).toEqual({ + a1: 1, + b2: 2, + }); }); }); diff --git a/src/object/mapValues/index.ts b/src/object/mapValues/index.ts index d67cf308..b95cbade 100644 --- a/src/object/mapValues/index.ts +++ b/src/object/mapValues/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/mapValues/method.ts b/src/object/mapValues/method.ts index ca454de6..77b74d0c 100644 --- a/src/object/mapValues/method.ts +++ b/src/object/mapValues/method.ts @@ -1,9 +1,15 @@ -import * as forEach from "../forEach/method"; +import forEach from "../forEach/method"; -const method = (obj: object, fn: (value: any, key: string, object: object) => any): object => { - const result: { [key: string]: any } = {}; +const method = ( + obj: T, + fn: (value: T[K], key: K, object: T) => any, +): object => { + const result: any = {}; - forEach(obj, (value, key, object) => result[key] = fn(value, key, object)); + forEach( + obj, + (value, key, object) => (result[key] = fn(value, key, object)), + ); return result; }; diff --git a/src/object/mapValues/test.ts b/src/object/mapValues/test.ts index c7a3e1c6..3817675b 100644 --- a/src/object/mapValues/test.ts +++ b/src/object/mapValues/test.ts @@ -1,11 +1,17 @@ -import "./index"; +import "."; describe("Object.prototype.$mapValues", () => { test( - "{fred: { user: \"fred\", age: 40 }, pebbles: { user: \"pebbles\", age: 1 }}.$mapValues(u => u.age) returns " + - "{ fred: 40, pebbles: 1 }", + // tslint:disable-next-line: max-line-length + '{fred: { user: "fred", age: 40 }, pebbles: { user: "pebbles", age: 1 }}.$mapValues(u => u.age) returns ' + + "{ fred: 40, pebbles: 1 }", () => { - expect({ fred: { user: "fred", age: 40 }, pebbles: { user: "pebbles", age: 1 } }.$mapValues((u) => u.age)) - .toEqual({ fred: 40, pebbles: 1 }); - }); + expect( + { + fred: { user: "fred", age: 40 }, + pebbles: { user: "pebbles", age: 1 }, + }.$mapValues(u => u.age), + ).toEqual({ fred: 40, pebbles: 1 }); + }, + ); }); diff --git a/src/object/merge/index.ts b/src/object/merge/index.ts index 67888cd9..74115028 100644 --- a/src/object/merge/index.ts +++ b/src/object/merge/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/merge/method.ts b/src/object/merge/method.ts index 66943e10..971e07f5 100644 --- a/src/object/merge/method.ts +++ b/src/object/merge/method.ts @@ -1,12 +1,15 @@ const method = (obj: object, ...objects: object[]): object => [obj, ...objects].reduce( - (prev: { [key: string]: any }, obj: { [key: string]: any }) => - Object.keys(obj).reduce((a, k) => { - prev[k] = prev.hasOwnProperty(k) ? [].concat(prev[k]).concat(obj[k]) : obj[k]; + (prev: { [key: string]: any }, obj2: { [key: string]: any }) => + Object.keys(obj2).reduce((a, k) => { + prev[k] = prev.hasOwnProperty(k) + ? [].concat(prev[k]).concat(obj2[k]) + : obj2[k]; return prev; + // tslint:disable-next-line: align }, {}), - {} + {}, ); export = method; diff --git a/src/object/merge/test.ts b/src/object/merge/test.ts index 91912cb7..64f1df21 100644 --- a/src/object/merge/test.ts +++ b/src/object/merge/test.ts @@ -1,11 +1,17 @@ -import "./index"; +import "."; describe("Object.prototype.$merge", () => { test( - "{a: [{ x: 2 }, { y: 4 }], b: 1}.$merge({a: { z: 3 }, b: [2, 3], c: \"foo\"}) returns " + - "{ a: [ { x: 2 }, { y: 4 }, { z: 3 } ], b: [ 1, 2, 3 ], c: \"foo\" }", + '{a: [{ x: 2 }, { y: 4 }], b: 1}.$merge({a: { z: 3 }, b: [2, 3], c: "foo"}) returns ' + + '{ a: [ { x: 2 }, { y: 4 }, { z: 3 } ], b: [ 1, 2, 3 ], c: "foo" }', () => { - expect({ a: [{ x: 2 }, { y: 4 }], b: 1 }.$merge({ a: { z: 3 }, b: [2, 3], c: "foo" })) - .toEqual({ a: [{ x: 2 }, { y: 4 }, { z: 3 }], b: [1, 2, 3], c: "foo" }); - }); + expect( + { a: [{ x: 2 }, { y: 4 }], b: 1 }.$merge({ + a: { z: 3 }, + b: [2, 3], + c: "foo", + }), + ).toEqual({ a: [{ x: 2 }, { y: 4 }, { z: 3 }], b: [1, 2, 3], c: "foo" }); + }, + ); }); diff --git a/src/object/methods.ts b/src/object/methods.ts index 977b36e3..e872a712 100644 --- a/src/object/methods.ts +++ b/src/object/methods.ts @@ -1,31 +1,31 @@ -import * as assign from "./assign/method"; -import * as camelCaseKeys from "./camelCaseKeys/method"; -import * as clone from "./clone/method"; -import * as defaults from "./defaults/method"; -import * as dig from "./dig/method"; -import * as empty from "./empty/method"; -import * as equals from "./equals/method"; -import * as flatten from "./flatten/method"; -import * as forEach from "./forEach/method"; -import * as get from "./get/method"; -import * as invert from "./invert/method"; -import * as isEmpty from "./isEmpty/method"; -import * as isObject from "./isObject/method"; -import * as isObjectLike from "./isObjectLike/method"; -import * as isPlainObject from "./isPlainObject/method"; -import * as kebabCaseKeys from "./kebabCaseKeys/method"; -import * as keys from "./keys/method"; -import * as lowerCaseKeys from "./lowerCaseKeys/method"; -import * as map from "./map/method"; -import * as mapKeys from "./mapKeys/method"; -import * as mapValues from "./mapValues/method"; -import * as merge from "./merge/method"; -import * as omit from "./omit/method"; -import * as reduce from "./reduce/method"; -import * as set from "./set/method"; -import * as size from "./size/method"; -import * as snakeCaseKeys from "./snakeCaseKeys/method"; -import * as values from "./values/method"; +import assign from "./assign/method"; +import camelCaseKeys from "./camelCaseKeys/method"; +import clone from "./clone/method"; +import defaults from "./defaults/method"; +import dig from "./dig/method"; +import empty from "./empty/method"; +import equals from "./equals/method"; +import flatten from "./flatten/method"; +import forEach from "./forEach/method"; +import get from "./get/method"; +import invert from "./invert/method"; +import isEmpty from "./isEmpty/method"; +import isObject from "./isObject/method"; +import isObjectLike from "./isObjectLike/method"; +import isPlainObject from "./isPlainObject/method"; +import kebabCaseKeys from "./kebabCaseKeys/method"; +import keys from "./keys/method"; +import lowerCaseKeys from "./lowerCaseKeys/method"; +import map from "./map/method"; +import mapKeys from "./mapKeys/method"; +import mapValues from "./mapValues/method"; +import merge from "./merge/method"; +import omit from "./omit/method"; +import reduce from "./reduce/method"; +import set from "./set/method"; +import size from "./size/method"; +import snakeCaseKeys from "./snakeCaseKeys/method"; +import values from "./values/method"; export { assign, diff --git a/src/object/omit/index.ts b/src/object/omit/index.ts index 406a5dda..a0d608c1 100644 --- a/src/object/omit/index.ts +++ b/src/object/omit/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/omit/method.ts b/src/object/omit/method.ts index db82df4a..a11be04b 100644 --- a/src/object/omit/method.ts +++ b/src/object/omit/method.ts @@ -1,11 +1,17 @@ -const method = (obj: object, arr: string[] | ((value: any, key: string, object: object) => any)): object => { +const method = ( + obj: object, + arr: string[] | ((value: any, key: string, object: object) => any), +): object => { let fn = arr as (value: any, key: string, object: object) => any; if (Array.isArray(arr)) fn = (v, k) => arr.indexOf(k) !== -1; return Object.keys(obj) - .filter((k) => !fn((obj as { [key: string]: any })[k], k, obj)) - .reduce((acc, key) => ((acc[key] = (obj as { [key: string]: any })[key]), acc), {} as { [key: string]: any }); + .filter(k => !fn((obj as { [key: string]: any })[k], k, obj)) + .reduce( + (acc, key) => ((acc[key] = (obj as { [key: string]: any })[key]), acc), + {} as { [key: string]: any }, + ); }; export = method; diff --git a/src/object/omit/test.ts b/src/object/omit/test.ts index 17ed85d9..0c483827 100644 --- a/src/object/omit/test.ts +++ b/src/object/omit/test.ts @@ -1,13 +1,13 @@ -import "./index"; +import "."; describe("Object.prototype.$omit", () => { test("{ a: 1, b: '2', c: 3 }.$omit(['b']) returns { a: 1, c: 3 }", () => { - expect({ a: 1, b: "2", c: 3 }.$omit(["b"])) - .toEqual({ a: 1, c: 3 }); + expect({ a: 1, b: "2", c: 3 }.$omit(["b"])).toEqual({ a: 1, c: 3 }); }); test("{ a: 1, b: '2', c: 3 }.$omit((x) => typeof x === 'number') returns { b: '2' }", () => { - expect({ a: 1, b: "2", c: 3 }.$omit((x) => typeof x === "number")) - .toEqual({ b: "2" }); + expect({ a: 1, b: "2", c: 3 }.$omit(x => typeof x === "number")).toEqual({ + b: "2", + }); }); }); diff --git a/src/object/reduce/index.ts b/src/object/reduce/index.ts index e74fd1bf..a4b5167d 100644 --- a/src/object/reduce/index.ts +++ b/src/object/reduce/index.ts @@ -1,9 +1,12 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { - $reduce(fn: (prev: T, value: any, key: string, object: object) => T, initialValue?: T): any; + $reduce( + fn: (prev: T, value: any, key: string, object: object) => T, + initialValue?: T, + ): any; } } diff --git a/src/object/reduce/method.ts b/src/object/reduce/method.ts index fc114d7b..fc8c0da8 100644 --- a/src/object/reduce/method.ts +++ b/src/object/reduce/method.ts @@ -1,13 +1,16 @@ -import * as forEach from "../forEach/method"; +import forEach from "../forEach/method"; -const method = ( - obj: object, - fn: (prev: any, value: any, key: string, object: object) => any, - initialValue: any = undefined +const method = ( + obj: T, + fn: (prev: P, value: T[K], key: K, object: T) => any, + initialValue: P = undefined as any, ) => { let reduced = initialValue; - forEach(obj, (value, key, object) => reduced = fn(reduced, value, key, object)); + forEach( + obj, + (value, key, object) => (reduced = fn(reduced, value, key, object)), + ); return reduced; }; diff --git a/src/object/reduce/test.ts b/src/object/reduce/test.ts index 4eb2b068..30a775f6 100644 --- a/src/object/reduce/test.ts +++ b/src/object/reduce/test.ts @@ -1,13 +1,23 @@ -import "./index"; +import "."; describe("Object.prototype.$reduce", () => { + // tslint:disable-next-line: max-line-length test("({foo:1, bar:2}).$reduce((prev, value, key) => [...prev, key + ':'' + value], []); ['foo:1', 'bar:2']", () => { - expect(({ foo: 1, bar: 2 }).$reduce((prev, value, key) => [...prev, key + ":" + value], [] as any[])) - .toEqual(["foo:1", "bar:2"]); + expect( + { foo: 1, bar: 2 }.$reduce( + (prev, value, key) => [...prev, `${key}:${value}`], + [] as any[], + ), + ).toEqual(["foo:1", "bar:2"]); }); + // tslint:disable-next-line: max-line-length test("({foo:1, bar:2}).$reduce((prev = [], value, key) => [...prev, key + ':'' + value]); ['foo:1', 'bar:2']", () => { - expect(({ foo: 1, bar: 2 }).$reduce((prev = [], value, key) => [...prev, key + ":" + value])) - .toEqual(["foo:1", "bar:2"]); + expect( + { foo: 1, bar: 2 }.$reduce((prev = [], value, key) => [ + ...prev, + `${key}:${value}`, + ]), + ).toEqual(["foo:1", "bar:2"]); }); }); diff --git a/src/object/set/index.ts b/src/object/set/index.ts index 68bd4e56..e9843187 100644 --- a/src/object/set/index.ts +++ b/src/object/set/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/set/method.ts b/src/object/set/method.ts index 35ec5894..233a2177 100644 --- a/src/object/set/method.ts +++ b/src/object/set/method.ts @@ -5,8 +5,9 @@ const method = (obj: object, path: string, value: any): any => { const length = keys.length; let i = 0; - for (; i < length - 1; i++) + for (; i < length - 1; i++) { obj = (obj as { [key: string]: any })[keys[i]]; + } (obj as { [key: string]: any })[keys[i]] = value; }; diff --git a/src/object/set/test.ts b/src/object/set/test.ts index 8e8af33c..89458521 100644 --- a/src/object/set/test.ts +++ b/src/object/set/test.ts @@ -1,6 +1,7 @@ -import "./index"; +import "."; describe("Object.prototype.$set", () => { + // tslint:disable-next-line: max-line-length test("{ selector: { to: { val: 'val to select' } } }.$set('selector.to.val', 'new value')", () => { const obj = { selector: { to: { val: "val to select" } } }; diff --git a/src/object/size/index.ts b/src/object/size/index.ts index f36e4fbd..bdbbac2a 100644 --- a/src/object/size/index.ts +++ b/src/object/size/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/size/method.ts b/src/object/size/method.ts index 6df00808..5238ade4 100644 --- a/src/object/size/method.ts +++ b/src/object/size/method.ts @@ -1,4 +1,4 @@ -const method = (obj: object): number => (obj as any).size || (obj as any).length || - Object.keys(obj).length; +const method = (obj: object): number => + (obj as any).size || (obj as any).length || Object.keys(obj).length; export = method; diff --git a/src/object/size/test.ts b/src/object/size/test.ts index 2b7b4c21..3c00ffda 100644 --- a/src/object/size/test.ts +++ b/src/object/size/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("Object.prototype.$size", () => { test("{ one: 1, two: 2, three: 3 }.$size() returns 3", () => { - expect({ one: 1, two: 2, three: 3 }.$size()) - .toBe(3); + expect({ one: 1, two: 2, three: 3 }.$size()).toBe(3); }); }); diff --git a/src/object/snakeCaseKeys/index.ts b/src/object/snakeCaseKeys/index.ts index cf91398f..e8ca6da9 100644 --- a/src/object/snakeCaseKeys/index.ts +++ b/src/object/snakeCaseKeys/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/snakeCaseKeys/method.ts b/src/object/snakeCaseKeys/method.ts index 9dd6442a..be7b030d 100644 --- a/src/object/snakeCaseKeys/method.ts +++ b/src/object/snakeCaseKeys/method.ts @@ -1,10 +1,10 @@ -import * as forEach from "../forEach/method"; -import * as snakeCase from "../../string/snakeCase/method"; +import snakeCase from "../../string/snakeCase/method"; +import forEach from "../forEach/method"; const method = (obj: object): object => { const result: { [key: string]: any } = {}; - forEach(obj, (value, key) => result[snakeCase(key)] = value); + forEach(obj, (value, key) => (result[snakeCase(key)] = value)); return result; }; diff --git a/src/object/snakeCaseKeys/test.ts b/src/object/snakeCaseKeys/test.ts index b7a580ea..263543ff 100644 --- a/src/object/snakeCaseKeys/test.ts +++ b/src/object/snakeCaseKeys/test.ts @@ -1,11 +1,13 @@ -import "./index"; +import "."; describe("Object.prototype.$snakeCaseKeys", () => { test( - "{ FirstName: \"Adam\", \"last-name\": \"Smith\" }.$snakeCaseKeys() returns " + - "{first_name: \"Adam\", last_name: \"Smith\"}", + '{ FirstName: "Adam", "last-name": "Smith" }.$snakeCaseKeys() returns ' + + '{first_name: "Adam", last_name: "Smith"}', () => { - expect({ "FirstName": "Adam", "last-name": "Smith" }.$snakeCaseKeys()) - .toEqual({ first_name: "Adam", last_name: "Smith" }); - }); + expect( + { FirstName: "Adam", "last-name": "Smith" }.$snakeCaseKeys(), + ).toEqual({ first_name: "Adam", last_name: "Smith" }); + }, + ); }); diff --git a/src/object/values/index.ts b/src/object/values/index.ts index c5a49417..0b40e863 100644 --- a/src/object/values/index.ts +++ b/src/object/values/index.ts @@ -1,5 +1,5 @@ import { addPrototype } from "../../utils"; -import * as method from "./method"; +import method from "./method"; declare global { interface Object { diff --git a/src/object/values/method.ts b/src/object/values/method.ts index 752a2588..5cb839be 100644 --- a/src/object/values/method.ts +++ b/src/object/values/method.ts @@ -1,9 +1,14 @@ -import * as reduce from "../reduce/method"; +import reduce from "../reduce/method"; -const method = (obj: object): any[] => reduce(obj, (prev, value) => { - prev.push(value); +const method = (obj: T) => + reduce>( + obj, + (prev, value) => { + prev.push(value); - return prev; -}, []); + return prev; + }, + [], + ); export = method; diff --git a/src/object/values/test.ts b/src/object/values/test.ts index 604b8d45..d7a2476e 100644 --- a/src/object/values/test.ts +++ b/src/object/values/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("Object.prototype.$values", () => { test("{ one: 1, two: 2, three: 3 }.$values() returns [1, 2, 3]", () => { - expect({ one: 1, two: 2, three: 3 }.$values()) - .toEqual([1, 2, 3]); + expect({ one: 1, two: 2, three: 3 }.$values()).toEqual([1, 2, 3]); }); }); diff --git a/src/string/base64/index.ts b/src/string/base64/index.ts index 0c091052..a7bba0d1 100644 --- a/src/string/base64/index.ts +++ b/src/string/base64/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/base64/test.ts b/src/string/base64/test.ts index 0981cf92..d71fc631 100644 --- a/src/string/base64/test.ts +++ b/src/string/base64/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("String.prototype.base64", () => { - test("\"prototyped.js\".base64() returns \"cHJvdG90eXBlZC5qcw==\"", () => { - expect("prototyped.js".base64()) - .toBe("cHJvdG90eXBlZC5qcw=="); + test('"prototyped.js".base64() returns "cHJvdG90eXBlZC5qcw=="', () => { + expect("prototyped.js".base64()).toBe("cHJvdG90eXBlZC5qcw=="); }); }); diff --git a/src/string/base64Decode/index.ts b/src/string/base64Decode/index.ts index a9ccb22a..53af15e4 100644 --- a/src/string/base64Decode/index.ts +++ b/src/string/base64Decode/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/base64Decode/test.ts b/src/string/base64Decode/test.ts index c611bed4..f0b72e39 100644 --- a/src/string/base64Decode/test.ts +++ b/src/string/base64Decode/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("String.prototype.base64Decode", () => { - test("\"cHJvdG90eXBlZC5qcw==\".base64Decode() returns \"prototyped.js\"", () => { - expect("cHJvdG90eXBlZC5qcw==".base64Decode()) - .toBe("prototyped.js"); + test('"cHJvdG90eXBlZC5qcw==".base64Decode() returns "prototyped.js"', () => { + expect("cHJvdG90eXBlZC5qcw==".base64Decode()).toBe("prototyped.js"); }); }); diff --git a/src/string/camelCase/index.ts b/src/string/camelCase/index.ts index 4a3a8dbc..db4ca695 100644 --- a/src/string/camelCase/index.ts +++ b/src/string/camelCase/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/camelCase/method.ts b/src/string/camelCase/method.ts index c8b9a204..78724bfa 100644 --- a/src/string/camelCase/method.ts +++ b/src/string/camelCase/method.ts @@ -1,7 +1,11 @@ const method = (str: string) => { str = ( - str.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+|[A-Z]|[0-9]+/g) || [""] - ).map((x) => x.slice(0, 1).toUpperCase() + x.slice(1).toLowerCase()).join(""); + str.match( + /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+|[A-Z]|[0-9]+/g, + ) || [""] + ) + .map(x => x.slice(0, 1).toUpperCase() + x.slice(1).toLowerCase()) + .join(""); return str.slice(0, 1).toLowerCase() + str.slice(1); }; diff --git a/src/string/camelCase/test.ts b/src/string/camelCase/test.ts index ea2836ef..130000d5 100644 --- a/src/string/camelCase/test.ts +++ b/src/string/camelCase/test.ts @@ -1,34 +1,40 @@ -import "./index"; +import "."; describe("String.prototype.camelCase", () => { - test("\"some_database_field_name\".camelCase() returns \"someDatabaseFieldName\"", () => { - expect("some_database_field_name".camelCase()) - .toBe("someDatabaseFieldName"); + test('"some_database_field_name".camelCase() returns "someDatabaseFieldName"', () => { + expect("some_database_field_name".camelCase()).toBe( + "someDatabaseFieldName", + ); }); - test("\"Some label that needs to be camelized\".camelCase() returns \"someLabelThatNeedsToBeCamelized\"", () => { - expect("Some label that needs to be camelized".camelCase()) - .toBe("someLabelThatNeedsToBeCamelized"); + // tslint:disable-next-line: max-line-length + test('"Some label that needs to be camelized".camelCase() returns "someLabelThatNeedsToBeCamelized"', () => { + expect("Some label that needs to be camelized".camelCase()).toBe( + "someLabelThatNeedsToBeCamelized", + ); }); - test("\"some-javascript-property\".camelCase() returns \"someJavascriptProperty\"", () => { - expect("some-javascript-property".camelCase()) - .toBe("someJavascriptProperty"); + test('"some-javascript-property".camelCase() returns "someJavascriptProperty"', () => { + expect("some-javascript-property".camelCase()).toBe( + "someJavascriptProperty", + ); }); - test("\"some-mixed_string with spaces_underscores-and-hyphens\".camelCase() returns " + - "\"someMixedStringWithSpacesUnderscoresAndHyphens\"", () => { - expect("some-mixed_string with spaces_underscores-and-hyphens".camelCase()) - .toBe("someMixedStringWithSpacesUnderscoresAndHyphens"); - }); + test( + '"some-mixed_string with spaces_underscores-and-hyphens".camelCase() returns ' + + '"someMixedStringWithSpacesUnderscoresAndHyphens"', + () => { + expect( + "some-mixed_string with spaces_underscores-and-hyphens".camelCase(), + ).toBe("someMixedStringWithSpacesUnderscoresAndHyphens"); + }, + ); - test("\"foo_bar-22\".camelCase() returns \"fooBar22\"", () => { - expect("foo_bar-22".camelCase()) - .toBe("fooBar22"); + test('"foo_bar-22".camelCase() returns "fooBar22"', () => { + expect("foo_bar-22".camelCase()).toBe("fooBar22"); }); - test("\"\".camelCase() returns \"\"", () => { - expect("".camelCase()) - .toBe(""); + test('"".camelCase() returns ""', () => { + expect("".camelCase()).toBe(""); }); }); diff --git a/src/string/capitalize/index.ts b/src/string/capitalize/index.ts index ded7d8d1..2df2b9c4 100644 --- a/src/string/capitalize/index.ts +++ b/src/string/capitalize/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/capitalize/method.ts b/src/string/capitalize/method.ts index 4da3d0c6..51a4c95c 100644 --- a/src/string/capitalize/method.ts +++ b/src/string/capitalize/method.ts @@ -1,7 +1,7 @@ const method = (str: string, allWords = false): string => { - if (allWords) return str.replace(/\b[a-z]/g, (char) => char.toUpperCase()); + if (allWords) return str.replace(/\b[a-z]/g, char => char.toUpperCase()); - return str.replace(/^[a-z]/, (char) => char.toUpperCase()); + return str.replace(/^[a-z]/, char => char.toUpperCase()); }; export = method; diff --git a/src/string/capitalize/test.ts b/src/string/capitalize/test.ts index 00cd0d65..d3944326 100644 --- a/src/string/capitalize/test.ts +++ b/src/string/capitalize/test.ts @@ -1,13 +1,11 @@ -import "./index"; +import "."; describe("String.prototype.capitalize", () => { - test("\"foo bar\".capitalize() returns \"Foo bar\"", () => { - expect("foo bar".capitalize()) - .toBe("Foo bar"); + test('"foo bar".capitalize() returns "Foo bar"', () => { + expect("foo bar".capitalize()).toBe("Foo bar"); }); - test("\"hello world\".capitalize(true) returns \"Hello World\"", () => { - expect("hello world".capitalize(true)) - .toBe("Hello World"); + test('"hello world".capitalize(true) returns "Hello World"', () => { + expect("hello world".capitalize(true)).toBe("Hello World"); }); }); diff --git a/src/string/chars/index.ts b/src/string/chars/index.ts index 26db76f6..074bfe5f 100644 --- a/src/string/chars/index.ts +++ b/src/string/chars/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/chars/test.ts b/src/string/chars/test.ts index b409fdfb..5ef587b4 100644 --- a/src/string/chars/test.ts +++ b/src/string/chars/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("String.prototype.chars", () => { - test("\"Hello\".chars() returns [\"H\", \"e\", \"l\", \"l\", \"o\"]", () => { - expect("Hello".chars()) - .toEqual(["H", "e", "l", "l", "o"]); + test('"Hello".chars() returns ["H", "e", "l", "l", "o"]', () => { + expect("Hello".chars()).toEqual(["H", "e", "l", "l", "o"]); }); }); diff --git a/src/string/contains/index.ts b/src/string/contains/index.ts index d6e29c30..3d6aaa51 100644 --- a/src/string/contains/index.ts +++ b/src/string/contains/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/contains/test.ts b/src/string/contains/test.ts index 79b1ba2b..509de759 100644 --- a/src/string/contains/test.ts +++ b/src/string/contains/test.ts @@ -1,13 +1,11 @@ -import "./index"; +import "."; describe("String.prototype.contains", () => { - test("\"javaScript & typescript\".contains(\"Typescript\"); // true", () => { - expect("javaScript & typescript".contains("Typescript")) - .toBe(true); + test('"javaScript & typescript".contains("Typescript"); // true', () => { + expect("javaScript & typescript".contains("Typescript")).toBe(true); }); - test("\"javaScript & typescript\".contains(\"Typescript\", true); // false", () => { - expect("javaScript & typescript".contains("Typescript", true)) - .toBe(false); + test('"javaScript & typescript".contains("Typescript", true); // false', () => { + expect("javaScript & typescript".contains("Typescript", true)).toBe(false); }); }); diff --git a/src/string/decapitalize/index.ts b/src/string/decapitalize/index.ts index 452b8c50..4f56c0fe 100644 --- a/src/string/decapitalize/index.ts +++ b/src/string/decapitalize/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/decapitalize/method.ts b/src/string/decapitalize/method.ts index 201f8718..d2d2e40c 100644 --- a/src/string/decapitalize/method.ts +++ b/src/string/decapitalize/method.ts @@ -1,7 +1,7 @@ const method = (str: string, allWords = false): string => { - if (allWords) return str.replace(/\b[A-Z]/g, (char) => char.toLowerCase()); + if (allWords) return str.replace(/\b[A-Z]/g, char => char.toLowerCase()); - return str.replace(/^[A-Z]/, (char) => char.toLowerCase()); + return str.replace(/^[A-Z]/, char => char.toLowerCase()); }; export = method; diff --git a/src/string/decapitalize/test.ts b/src/string/decapitalize/test.ts index d48ea7be..8baffa37 100644 --- a/src/string/decapitalize/test.ts +++ b/src/string/decapitalize/test.ts @@ -1,13 +1,11 @@ -import "./index"; +import "."; describe("String.prototype.decapitalize", () => { - test("\"Foo Bar\".decapitalize() returns \"foo Bar\"", () => { - expect("Foo Bar".decapitalize()) - .toBe("foo Bar"); + test('"Foo Bar".decapitalize() returns "foo Bar"', () => { + expect("Foo Bar".decapitalize()).toBe("foo Bar"); }); - test("\"Hello World\".decapitalize(true) returns \"hello world\"", () => { - expect("Hello World".decapitalize(true)) - .toBe("hello world"); + test('"Hello World".decapitalize(true) returns "hello world"', () => { + expect("Hello World".decapitalize(true)).toBe("hello world"); }); }); diff --git a/src/string/equals/index.ts b/src/string/equals/index.ts index 0d163610..264357d4 100644 --- a/src/string/equals/index.ts +++ b/src/string/equals/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/equals/test.ts b/src/string/equals/test.ts index 37bc0a86..3be49736 100644 --- a/src/string/equals/test.ts +++ b/src/string/equals/test.ts @@ -1,11 +1,11 @@ -import "./index"; +import "."; describe("String.prototype.equals", () => { - test("\"hello\".lines(\"hello\") returns true", () => { + test('"hello".lines("hello") returns true', () => { expect("hello".equals("hello")).toBe(true); }); - test("\"hello\".lines(\"Hello\") returns false", () => { + test('"hello".lines("Hello") returns false', () => { expect("hello".equals("Hello")).toBe(false); }); }); diff --git a/src/string/forEach/index.ts b/src/string/forEach/index.ts index 8a5fc407..4d11dc61 100644 --- a/src/string/forEach/index.ts +++ b/src/string/forEach/index.ts @@ -1,6 +1,5 @@ - -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/forEach/method.ts b/src/string/forEach/method.ts index 29c92ed0..94424e7c 100644 --- a/src/string/forEach/method.ts +++ b/src/string/forEach/method.ts @@ -1,4 +1,6 @@ -const method = (str: string, fn: (char: string, index: number, chars: string[]) => void) => - str.split("").forEach(fn); +const method = ( + str: string, + fn: (char: string, index: number, chars: string[]) => void, +) => str.split("").forEach(fn); export = method; diff --git a/src/string/forEach/test.ts b/src/string/forEach/test.ts index 2defff21..c6cdbbb9 100644 --- a/src/string/forEach/test.ts +++ b/src/string/forEach/test.ts @@ -1,7 +1,7 @@ -import "./index"; +import "."; describe("String.prototype.forEach", () => { - test("\"Hello\".forEach((char, i) => char == \"o\" && (index = i)); // index === 4", () => { + test('"Hello".forEach((char, i) => char == "o" && (index = i)); // index === 4', () => { let index = -1; "Hello".forEach((char, i) => char === "o" && (index = i)); diff --git a/src/string/humanize/index.ts b/src/string/humanize/index.ts index cb66a7e2..36b39329 100644 --- a/src/string/humanize/index.ts +++ b/src/string/humanize/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { @@ -14,6 +14,7 @@ declare global { * @function humanize * @returns {String} * @example - * ' capitalize dash-CamelCase_underscore trim '.humanize(); // 'Capitalize dash camel case underscore trim' + * ' capitalize dash-CamelCase_underscore trim '.humanize(); + * // 'Capitalize dash camel case underscore trim' */ addPrototype(String, "humanize", method); diff --git a/src/string/humanize/method.ts b/src/string/humanize/method.ts index 910fe981..e4952682 100644 --- a/src/string/humanize/method.ts +++ b/src/string/humanize/method.ts @@ -1,5 +1,11 @@ -const method = (str: string): string => ( - str.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g) || [""] -).map((x) => x.toLowerCase()).join(" ").replace(/^[a-z]/, (char) => char.toUpperCase()); +const method = (str: string): string => + ( + str.match( + /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+[0-9]*|[A-Z]|[0-9]+/g, + ) || [""] + ) + .map(x => x.toLowerCase()) + .join(" ") + .replace(/^[a-z]/, char => char.toUpperCase()); export = method; diff --git a/src/string/humanize/test.ts b/src/string/humanize/test.ts index 1be984fa..2337fc7e 100644 --- a/src/string/humanize/test.ts +++ b/src/string/humanize/test.ts @@ -1,16 +1,17 @@ -import "./index"; +import "."; describe("String.prototype.humanize", () => { test( - "\" capitalize dash-CamelCase_underscore trim \".humanize() returns " + - "\"Capitalize dash camel case underscore trim\"", + '" capitalize dash-CamelCase_underscore trim ".humanize() returns ' + + '"Capitalize dash camel case underscore trim"', () => { - expect(" capitalize dash-CamelCase_underscore trim ".humanize()) - .toBe("Capitalize dash camel case underscore trim"); - }); + expect(" capitalize dash-CamelCase_underscore trim ".humanize()).toBe( + "Capitalize dash camel case underscore trim", + ); + }, + ); - test("\"\".humanize() returns \"\"", () => { - expect("".humanize()) - .toBe(""); + test('"".humanize() returns ""', () => { + expect("".humanize()).toBe(""); }); }); diff --git a/src/string/isEmpty/index.ts b/src/string/isEmpty/index.ts index 7020a57e..a947face 100644 --- a/src/string/isEmpty/index.ts +++ b/src/string/isEmpty/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/isEmpty/test.ts b/src/string/isEmpty/test.ts index dfa877ce..22a9323c 100644 --- a/src/string/isEmpty/test.ts +++ b/src/string/isEmpty/test.ts @@ -1,11 +1,11 @@ -import "./index"; +import "."; describe("String.prototype.isEmpty", () => { - test("\"123\".isEmpty() returns false", () => { + test('"123".isEmpty() returns false', () => { expect("123".isEmpty()).toBe(false); }); - test("\"\".isEmpty() returns true", () => { + test('"".isEmpty() returns true', () => { expect("".isEmpty()).toBe(true); }); }); diff --git a/src/string/isString/index.ts b/src/string/isString/index.ts index 16a9372e..c23ce90c 100644 --- a/src/string/isString/index.ts +++ b/src/string/isString/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface StringConstructor { diff --git a/src/string/isString/test.ts b/src/string/isString/test.ts index 36c1f9ee..5cf59b28 100644 --- a/src/string/isString/test.ts +++ b/src/string/isString/test.ts @@ -1,13 +1,11 @@ -import "./index"; +import "."; describe("String.isString", () => { test("String.isString(2) returns false", () => { - expect(String.isString(2)) - .toBe(false); + expect(String.isString(2)).toBe(false); }); - test("String.isString(\"foo bar\") returns true", () => { - expect(String.isString("foo bar")) - .toBe(true); + test('String.isString("foo bar") returns true', () => { + expect(String.isString("foo bar")).toBe(true); }); }); diff --git a/src/string/kebabCase/index.ts b/src/string/kebabCase/index.ts index c5c8de2d..941f2574 100644 --- a/src/string/kebabCase/index.ts +++ b/src/string/kebabCase/index.ts @@ -1,5 +1,6 @@ -import * as method from "./method"; +// tslint:disable: max-line-length import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/kebabCase/method.ts b/src/string/kebabCase/method.ts index 4a107ee1..cd11f1e9 100644 --- a/src/string/kebabCase/method.ts +++ b/src/string/kebabCase/method.ts @@ -1,5 +1,10 @@ -const method = (str: string): string => ( - str.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+|[A-Z]|[0-9]+/g) || [""] -).map((x) => x.toLowerCase()).join("-"); +const method = (str: string): string => + ( + str.match( + /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+|[A-Z]|[0-9]+/g, + ) || [""] + ) + .map(x => x.toLowerCase()) + .join("-"); export = method; diff --git a/src/string/kebabCase/test.ts b/src/string/kebabCase/test.ts index bffd44f6..021ba3e5 100644 --- a/src/string/kebabCase/test.ts +++ b/src/string/kebabCase/test.ts @@ -1,42 +1,43 @@ -import "./index"; +import "."; describe("String.prototype.kebabCase", () => { - test("\"camelCase\".kebabCase() returns \"camel-case\"", () => { - expect("camelCase".kebabCase()) - .toBe("camel-case"); + test('"camelCase".kebabCase() returns "camel-case"', () => { + expect("camelCase".kebabCase()).toBe("camel-case"); }); - test("\"some text\".kebabCase() returns \"some-text\"", () => { - expect("some text".kebabCase()) - .toBe("some-text"); + test('"some text".kebabCase() returns "some-text"', () => { + expect("some text".kebabCase()).toBe("some-text"); }); - test("\"some-mixed_string With spaces_underscores-and-hyphens\".kebabCase() returns " + - "\"some-mixed-string-with-spaces-underscores-and-hyphens\"", () => { - expect("some-mixed_string With spaces_underscores-and-hyphens".kebabCase()) - .toBe("some-mixed-string-with-spaces-underscores-and-hyphens"); - }); + test( + '"some-mixed_string With spaces_underscores-and-hyphens".kebabCase() returns ' + + '"some-mixed-string-with-spaces-underscores-and-hyphens"', + () => { + expect( + "some-mixed_string With spaces_underscores-and-hyphens".kebabCase(), + ).toBe("some-mixed-string-with-spaces-underscores-and-hyphens"); + }, + ); - test("\"AllThe-small Things\".kebabCase() returns \"all-the-small-things\"", () => { - expect("AllThe-small Things".kebabCase()) - .toBe("all-the-small-things"); + test('"AllThe-small Things".kebabCase() returns "all-the-small-things"', () => { + expect("AllThe-small Things".kebabCase()).toBe("all-the-small-things"); }); - test( - "\"IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML\".kebabCase() returns " + - "\"i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html\"", - () => { - expect("IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML".kebabCase()) - .toBe("i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html"); - }); + test(// tslint:disable-next-line: max-line-length + '"IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML".kebabCase() returns "i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html"', () => { + expect( + "IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML".kebabCase(), + ).toBe( + // tslint:disable-next-line: max-line-length + "i-am-listening-to-fm-while-loading-different-url-on-my-browser-and-also-editing-some-xml-and-html", + ); + }); - test("\"foo_Bar22\".kebabCase() returns \"foo-bar-22\"", () => { - expect("foo_Bar22".kebabCase()) - .toBe("foo-bar-22"); + test('"foo_Bar22".kebabCase() returns "foo-bar-22"', () => { + expect("foo_Bar22".kebabCase()).toBe("foo-bar-22"); }); - test("\"\".kebabCase() returns \"\"", () => { - expect("".kebabCase()) - .toBe(""); + test('"".kebabCase() returns ""', () => { + expect("".kebabCase()).toBe(""); }); }); diff --git a/src/string/lines/index.ts b/src/string/lines/index.ts index 31c39b6c..7d8ab51f 100644 --- a/src/string/lines/index.ts +++ b/src/string/lines/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/lines/test.ts b/src/string/lines/test.ts index 24862cf0..951457f6 100644 --- a/src/string/lines/test.ts +++ b/src/string/lines/test.ts @@ -1,9 +1,14 @@ -import "./index"; +import "."; describe("String.prototype.lines", () => { - test("\"This\nis a\nmultiline\nstring.\n\".lines() returns [\"This\", \"is a\", \"multiline\", \"string.\" , \"\"]", - () => { - expect("This\nis a\nmultiline\nstring.\n".lines()) - .toEqual(["This", "is a", "multiline", "string.", ""]); - }); + // tslint:disable-next-line: max-line-length + test('"This\nis a\nmultiline\nstring.\n".lines() returns ["This", "is a", "multiline", "string." , ""]', () => { + expect("This\nis a\nmultiline\nstring.\n".lines()).toEqual([ + "This", + "is a", + "multiline", + "string.", + "", + ]); + }); }); diff --git a/src/string/map/index.ts b/src/string/map/index.ts index 8377d0a5..9d6896c2 100644 --- a/src/string/map/index.ts +++ b/src/string/map/index.ts @@ -1,7 +1,7 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; -export { }; +export {}; declare global { interface String { diff --git a/src/string/map/method.ts b/src/string/map/method.ts index dc1c7c0a..9e04fcc6 100644 --- a/src/string/map/method.ts +++ b/src/string/map/method.ts @@ -1,4 +1,10 @@ -const method = (str: string, fn: (char: string, index: number, chars: string[]) => string): string => - str.split("").map(fn).join(""); +const method = ( + str: string, + fn: (char: string, index: number, chars: string[]) => string, +): string => + str + .split("") + .map(fn) + .join(""); export = method; diff --git a/src/string/map/test.ts b/src/string/map/test.ts index b70b8944..f069d8d7 100644 --- a/src/string/map/test.ts +++ b/src/string/map/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("String.prototype.map", () => { - test("\"Hello\".map((char) => char == \"o\" ? \"O\" : char) returns \"HellO\"", () => { - expect("Hello".map((char) => char === "o" ? "O" : char)) - .toBe("HellO"); + test('"Hello".map((char) => char == "o" ? "O" : char) returns "HellO"', () => { + expect("Hello".map(char => (char === "o" ? "O" : char))).toBe("HellO"); }); }); diff --git a/src/string/mask/index.ts b/src/string/mask/index.ts index 5223e426..71f0ede2 100644 --- a/src/string/mask/index.ts +++ b/src/string/mask/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/mask/method.ts b/src/string/mask/method.ts index 423c7b39..90d195d8 100644 --- a/src/string/mask/method.ts +++ b/src/string/mask/method.ts @@ -1,3 +1,4 @@ -const method = (str: string, num = 4, mask = "*"): string => str.slice(0, -num).replace(/./g, mask) + str.slice(-num); +const method = (str: string, num = 4, mask = "*"): string => + str.slice(0, -num).replace(/./g, mask) + str.slice(-num); export = method; diff --git a/src/string/mask/test.ts b/src/string/mask/test.ts index 34561a32..40602ac1 100644 --- a/src/string/mask/test.ts +++ b/src/string/mask/test.ts @@ -1,18 +1,15 @@ -import "./index"; +import "."; describe("String.prototype.mask", () => { - test("\"1234567890\".mask() returns \"******7890\"", () => { - expect("1234567890".mask()) - .toBe("******7890"); + test('"1234567890".mask() returns "******7890"', () => { + expect("1234567890".mask()).toBe("******7890"); }); - test("\"1234567890\".mask(3) returns \"*******890\"", () => { - expect("1234567890".mask(3)) - .toBe("*******890"); + test('"1234567890".mask(3) returns "*******890"', () => { + expect("1234567890".mask(3)).toBe("*******890"); }); - test("\"1234567890\".mask(-4, \"$\") returns \"$$$$567890\"", () => { - expect("1234567890".mask(-4, "$")) - .toBe("$$$$567890"); + test('"1234567890".mask(-4, "$") returns "$$$$567890"', () => { + expect("1234567890".mask(-4, "$")).toBe("$$$$567890"); }); }); diff --git a/src/string/methods.ts b/src/string/methods.ts index 74184b0c..daaa6531 100644 --- a/src/string/methods.ts +++ b/src/string/methods.ts @@ -1,29 +1,29 @@ -import * as base64 from "./base64/method"; -import * as base64Decode from "./base64Decode/method"; -import * as camelCase from "./camelCase/method"; -import * as capitalize from "./capitalize/method"; -import * as chars from "./chars/method"; -import * as contains from "./contains/method"; -import * as decapitalize from "./decapitalize/method"; -import * as equals from "./equals/method"; -import * as forEach from "./forEach/method"; -import * as humanize from "./humanize/method"; -import * as isEmpty from "./isEmpty/method"; -import * as isString from "./isString/method"; -import * as kebabCase from "./kebabCase/method"; -import * as lines from "./lines/method"; -import * as map from "./map/method"; -import * as mask from "./mask/method"; -import * as pad from "./pad/method"; -import * as parseInt from "./parseInt/method"; -import * as pluralize from "./pluralize/method"; -import * as reduce from "./reduce/method"; -import * as repeat from "./repeat/method"; -import * as reverse from "./reverse/method"; -import * as snakeCase from "./snakeCase/method"; -import * as swapCase from "./swapCase/method"; -import * as truncate from "./truncate/method"; -import * as words from "./words/method"; +import base64 from "./base64/method"; +import base64Decode from "./base64Decode/method"; +import camelCase from "./camelCase/method"; +import capitalize from "./capitalize/method"; +import chars from "./chars/method"; +import contains from "./contains/method"; +import decapitalize from "./decapitalize/method"; +import equals from "./equals/method"; +import forEach from "./forEach/method"; +import humanize from "./humanize/method"; +import isEmpty from "./isEmpty/method"; +import isString from "./isString/method"; +import kebabCase from "./kebabCase/method"; +import lines from "./lines/method"; +import map from "./map/method"; +import mask from "./mask/method"; +import pad from "./pad/method"; +import parseInt from "./parseInt/method"; +import pluralize from "./pluralize/method"; +import reduce from "./reduce/method"; +import repeat from "./repeat/method"; +import reverse from "./reverse/method"; +import snakeCase from "./snakeCase/method"; +import swapCase from "./swapCase/method"; +import truncate from "./truncate/method"; +import words from "./words/method"; export { base64, diff --git a/src/string/pad/index.ts b/src/string/pad/index.ts index 7c582d50..4d4dc3c4 100644 --- a/src/string/pad/index.ts +++ b/src/string/pad/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/pad/method.ts b/src/string/pad/method.ts index bba0e519..04a6f914 100644 --- a/src/string/pad/method.ts +++ b/src/string/pad/method.ts @@ -1,4 +1,4 @@ -import * as repeat from "../repeat/method"; +import repeat from "../repeat/method"; const method = (str: string, size: number, value: string = " "): string => { const s = Math.abs(size); diff --git a/src/string/pad/test.ts b/src/string/pad/test.ts index 5648d637..c02b872d 100644 --- a/src/string/pad/test.ts +++ b/src/string/pad/test.ts @@ -1,15 +1,15 @@ -import "./index"; +import "."; describe("String.prototype.pad", () => { - test("\"123\".pad(2) returns \"123\"", () => { + test('"123".pad(2) returns "123"', () => { expect("123".pad(2)).toEqual("123"); }); - test("\"123\".pad(5) returns \"123 \"", () => { + test('"123".pad(5) returns "123 "', () => { expect("123".pad(5)).toEqual("123 "); }); - test("\"123\".pad(-5, \"1\") returns \"11123\"", () => { + test('"123".pad(-5, "1") returns "11123"', () => { expect("123".pad(-5, "1")).toEqual("11123"); }); }); diff --git a/src/string/parseInt/index.ts b/src/string/parseInt/index.ts index 745caa2d..40c1f66a 100644 --- a/src/string/parseInt/index.ts +++ b/src/string/parseInt/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/parseInt/method.ts b/src/string/parseInt/method.ts index 5b7a1fde..6c0b981f 100644 --- a/src/string/parseInt/method.ts +++ b/src/string/parseInt/method.ts @@ -1,3 +1,4 @@ -const method = (str: string, radix?: number): number => Number.parseInt(str, radix); +const method = (str: string, radix?: number): number => + Number.parseInt(str, radix); export = method; diff --git a/src/string/parseInt/test.ts b/src/string/parseInt/test.ts index 4ba07a47..9a949167 100644 --- a/src/string/parseInt/test.ts +++ b/src/string/parseInt/test.ts @@ -1,7 +1,7 @@ -import "./index"; +import "."; describe("String.prototype.parseInt", () => { - test("\"08\".parseInt() returns 8", () => { + test('"08".parseInt() returns 8', () => { expect("08".parseInt()).toBe(8); }); }); diff --git a/src/string/pluralize/index.ts b/src/string/pluralize/index.ts index 74e83461..a765aacf 100644 --- a/src/string/pluralize/index.ts +++ b/src/string/pluralize/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/pluralize/method.ts b/src/string/pluralize/method.ts index 39ce34f1..1fa1f5d9 100644 --- a/src/string/pluralize/method.ts +++ b/src/string/pluralize/method.ts @@ -1,24 +1,58 @@ -import * as isString from "../isString/method"; +import isString from "../isString/method"; const IRREGULAR_RULES = [ // Pronouns. - ["I", "we"], ["me", "us"], ["he", "they"], ["she", "they"], ["them", "them"], ["myself", "ourselves"], - ["yourself", "yourselves"], ["itself", "themselves"], ["herself", "themselves"], - ["himself", "themselves"], ["themself", "themselves"], ["is", "are"], ["was", "were"], ["has", "have"], - ["this", "these"], ["that", "those"], + ["I", "we"], + ["me", "us"], + ["he", "they"], + ["she", "they"], + ["them", "them"], + ["myself", "ourselves"], + ["yourself", "yourselves"], + ["itself", "themselves"], + ["herself", "themselves"], + ["himself", "themselves"], + ["themself", "themselves"], + ["is", "are"], + ["was", "were"], + ["has", "have"], + ["this", "these"], + ["that", "those"], // Words ending in with a consonant and `o`. - ["echo", "echoes"], ["dingo", "dingoes"], ["volcano", "volcanoes"], ["tornado", "tornadoes"], + ["echo", "echoes"], + ["dingo", "dingoes"], + ["volcano", "volcanoes"], + ["tornado", "tornadoes"], ["torpedo", "torpedoes"], // Ends with `us`. - ["genus", "genera"], ["viscus", "viscera"], + ["genus", "genera"], + ["viscus", "viscera"], // Ends with `ma`. - ["stigma", "stigmata"], ["stoma", "stomata"], ["dogma", "dogmata"], ["lemma", "lemmata"], - ["schema", "schemata"], ["anathema", "anathemata"], + ["stigma", "stigmata"], + ["stoma", "stomata"], + ["dogma", "dogmata"], + ["lemma", "lemmata"], + ["schema", "schemata"], + ["anathema", "anathemata"], // Other irregular rules. - ["ox", "oxen"], ["axe", "axes"], ["die", "dice"], ["yes", "yeses"], ["foot", "feet"], ["eave", "eaves"], - ["goose", "geese"], ["tooth", "teeth"], ["quiz", "quizzes"], ["human", "humans"], ["proof", "proofs"], - ["carve", "carves"], ["valve", "valves"], ["looey", "looies"], ["thief", "thieves"], ["groove", "grooves"], - ["pickaxe", "pickaxes"], ["whiskey", "whiskies"], + ["ox", "oxen"], + ["axe", "axes"], + ["die", "dice"], + ["yes", "yeses"], + ["foot", "feet"], + ["eave", "eaves"], + ["goose", "geese"], + ["tooth", "teeth"], + ["quiz", "quizzes"], + ["human", "humans"], + ["proof", "proofs"], + ["carve", "carves"], + ["valve", "valves"], + ["looey", "looies"], + ["thief", "thieves"], + ["groove", "grooves"], + ["pickaxe", "pickaxes"], + ["whiskey", "whiskies"], ]; const PLURALIZATION_RUES: Array<[RegExp | string, string]> = [ @@ -29,13 +63,23 @@ const PLURALIZATION_RUES: Array<[RegExp | string, string]> = [ [/(alias|[^aou]us|t[lm]as|gas|ris)$/i, "$1es"], [/(e[mn]u)s?$/i, "$1s"], [/([^l]ias|[aeiou]las|[ejzr]as|[iu]am)$/i, "$1"], - [/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1i"], + [ + // tslint:disable-next-line: max-line-length + /(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, + "$1i", + ], [/(alumn|alg|vertebr)(?:a|ae)$/i, "$1ae"], [/(seraph|cherub)(?:im)?$/i, "$1im"], [/(her|at|gr)o$/i, "$1oes"], - // tslint:disable:max-line-length - [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, "$1a"], - [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, "$1a"], + [ + // tslint:disable:max-line-length + /(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|automat|quor)(?:a|um)$/i, + "$1a", + ], + [ + /(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)(?:a|on)$/i, + "$1a", + ], [/sis$/i, "ses"], [/(?:(kni|wi|li)fe|(ar|l|ea|eo|oa|hoo)f)$/i, "$1$2ves"], [/([^aeiouy]|qu)y$/i, "$1ies"], @@ -56,17 +100,35 @@ const SINGULARIZATION_RULES: Array<[RegExp, string]> = [ [/(wi|kni|(?:after|half|high|low|mid|non|night|[^\w]|^)li)ves$/i, "$1fe"], [/(ar|(?:wo|[ae])l|[eo][ao])ves$/i, "$1f"], [/ies$/i, "y"], - [/\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, "$1ie"], + [ + /\b([pl]|zomb|(?:neck|cross)?t|coll|faer|food|gen|goon|group|lass|talk|goal|cut)ies$/i, + "$1ie", + ], [/\b(mon|smil)ies$/i, "$1ey"], [/\b((?:tit)?m|l)ice$/i, "$1ouse"], [/(seraph|cherub)im$/i, "$1"], - [/(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|ris)(?:es)?$/i, "$1"], - [/(analy|ba|diagno|parenthe|progno|synop|the|empha|cri)(?:sis|ses)$/i, "$1sis"], + [ + /(x|ch|ss|sh|zz|tto|go|cho|alias|[^aou]us|t[lm]as|gas|(?:her|at|gr)o|ris)(?:es)?$/i, + "$1", + ], + [ + /(analy|ba|diagno|parenthe|progno|synop|the|empha|cri)(?:sis|ses)$/i, + "$1sis", + ], [/(movie|twelve|abuse|e[mn]u)s$/i, "$1"], [/(test)(?:is|es)$/i, "$1is"], - [/(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, "$1us"], - [/(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, "$1um"], - [/(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, "$1on"], + [ + /(alumn|syllab|octop|vir|radi|nucle|fung|cact|stimul|termin|bacill|foc|uter|loc|strat)(?:us|i)$/i, + "$1us", + ], + [ + /(agend|addend|millenni|dat|extrem|bacteri|desiderat|strat|candelabr|errat|ov|symposi|curricul|quor)a$/i, + "$1um", + ], + [ + /(apheli|hyperbat|periheli|asyndet|noumen|phenomen|criteri|organ|prolegomen|hedr|automat)a$/i, + "$1on", + ], [/(alumn|alg|vertebr)ae$/i, "$1a"], [/(cod|mur|sil|vert|ind)ices$/i, "$1ex"], [/(matr|append)ices$/i, "$1ix"], @@ -78,15 +140,93 @@ const SINGULARIZATION_RULES: Array<[RegExp, string]> = [ const UNCOUNTABLE_RULES = [ // Singular words with no plurals. - "adulthood", "advice", "agenda", "aid", "alcohol", "ammo", "anime", "athletics", "audio", "bison", - "blood", "bream", "buffalo", "butter", "carp", "cash", "chassis", "chess", "clothing", "cod", "commerce", - "cooperation", "corps", "debris", "diabetes", "digestion", "elk", "energy", "equipment", "excretion", - "expertise", "flounder", "fun", "gallows", "garbage", "graffiti", "headquarters", "health", "herpes", - "highjinks", "homework", "housework", "information", "jeans", "justice", "kudos", "labour", "literature", - "machinery", "mackerel", "mail", "media", "mews", "moose", "music", "mud", "manga", "news", "pike", - "plankton", "pliers", "police", "pollution", "premises", "rain", "research", "rice", "salmon", "scissors", - "series", "sewage", "shambles", "shrimp", "species", "staff", "swine", "tennis", "traffic", "transportation", - "trout", "tuna", "wealth", "welfare", "whiting", "wildebeest", "wildlife", "you", + "adulthood", + "advice", + "agenda", + "aid", + "alcohol", + "ammo", + "anime", + "athletics", + "audio", + "bison", + "blood", + "bream", + "buffalo", + "butter", + "carp", + "cash", + "chassis", + "chess", + "clothing", + "cod", + "commerce", + "cooperation", + "corps", + "debris", + "diabetes", + "digestion", + "elk", + "energy", + "equipment", + "excretion", + "expertise", + "flounder", + "fun", + "gallows", + "garbage", + "graffiti", + "headquarters", + "health", + "herpes", + "highjinks", + "homework", + "housework", + "information", + "jeans", + "justice", + "kudos", + "labour", + "literature", + "machinery", + "mackerel", + "mail", + "media", + "mews", + "moose", + "music", + "mud", + "manga", + "news", + "pike", + "plankton", + "pliers", + "police", + "pollution", + "premises", + "rain", + "research", + "rice", + "salmon", + "scissors", + "series", + "sewage", + "shambles", + "shrimp", + "species", + "staff", + "swine", + "tennis", + "traffic", + "transportation", + "trout", + "tuna", + "wealth", + "welfare", + "whiting", + "wildebeest", + "wildlife", + "you", // RegExes. /[^aeiou]ese$/i, // "chinese", "japanese" /deer$/i, // "deer", "reindeer" @@ -112,7 +252,8 @@ const irregularSingles: { [keys: string]: string } = {}; * @param {RegExp|String} rule * @return {RegExp} */ -const sanitizeRule = (rule: RegExp | string) => isString(rule) ? new RegExp(`^${rule}$`, "i") : rule; +const sanitizeRule = (rule: RegExp | string) => + isString(rule) ? new RegExp(`^${rule}$`, "i") : rule; /** * Pass in a word token to produce a function that can replicate the case on @@ -131,8 +272,9 @@ const restoreCase = (word: string, token: string) => { if (word === word.toUpperCase()) return token.toUpperCase(); // Title cased words. E.g. "Title". - if (word[0] === word[0].toUpperCase()) + if (word[0] === word[0].toUpperCase()) { return token.charAt(0).toUpperCase() + token.substr(1).toLowerCase(); + } // Lower cased words. E.g. "test". return token.toLowerCase(); @@ -147,40 +289,46 @@ const restoreCase = (word: string, token: string) => { * @param {Array} rules * @return {Function} */ -const replaceWord = (replaceMap: { [keys: string]: string }, keepMap: { [keys: string]: string }, rules: Array<[RegExp, string]>) => - (word: string) => { - // Get the correct token and case restoration functions. - const token = word.toLowerCase(); - - // Check against the keep object map. - if (keepMap.hasOwnProperty(token)) return restoreCase(word, token); - - // Check against the replacement map for a direct word replacement. - if (replaceMap.hasOwnProperty(token)) return restoreCase(word, replaceMap[token]); +const replaceWord = ( + replaceMap: { [keys: string]: string }, + keepMap: { [keys: string]: string }, + rules: Array<[RegExp, string]>, +) => (word: string) => { + // Get the correct token and case restoration functions. + const token = word.toLowerCase(); + + // Check against the keep object map. + if (keepMap.hasOwnProperty(token)) return restoreCase(word, token); + + // Check against the replacement map for a direct word replacement. + if (replaceMap.hasOwnProperty(token)) { + return restoreCase(word, replaceMap[token]); + } - // Run all the rules against the word. + // Run all the rules against the word. - if (!token.length || uncountables.hasOwnProperty(token)) return word; + if (!token.length || uncountables.hasOwnProperty(token)) return word; - let len = rules.length; + let len = rules.length; - // Iterate over the sanitization rules and use the first one to match. - while (len--) { - const rule = rules[len]; + // Iterate over the sanitization rules and use the first one to match. + while (len--) { + const rule = rules[len]; - if (rule[0].test(word)) - return word.replace(rule[0], (match, index, ...rest) => { - const args = [match, index].concat(rest); - const result = rule[1].replace(/\$(\d{1,2})/g, (match, index) => args[index] || ""); + if (rule[0].test(word)) { + return word.replace(rule[0], (match, index, ...rest) => { + const args = [match, index].concat(rest); + const result = rule[1].replace(/\$(\d{1,2})/g, (_, i) => args[i] || ""); - if (match === "") return restoreCase(word[index - 1], result); + if (match === "") return restoreCase(word[index - 1], result); - return restoreCase(match, result); - }); + return restoreCase(match, result); + }); } + } - return word; - }; + return word; +}; /** * Add a pluralization rule to the collection. @@ -190,7 +338,7 @@ const replaceWord = (replaceMap: { [keys: string]: string }, keepMap: { [keys: s * @param {String} replacement */ const addPluralRule = (rule: string | RegExp, replacement: string) => - pluralRules.push([sanitizeRule(rule), replacement]); + pluralRules.push([sanitizeRule(rule) as any, replacement]); /** * Add a singularization rule to the collection. @@ -200,21 +348,21 @@ const addPluralRule = (rule: string | RegExp, replacement: string) => * @param {String} replacement */ const addSingularRule = (rule: string | RegExp, replacement: string) => - singularRules.push([sanitizeRule(rule), replacement]); + singularRules.push([sanitizeRule(rule) as any, replacement]); -IRREGULAR_RULES.forEach((rule) => { - const plural = rule[1].toLowerCase(); +IRREGULAR_RULES.forEach(rule => { + const pl = rule[1].toLowerCase(); const single = rule[0].toLowerCase(); - irregularSingles[single] = plural; - irregularPlurals[plural] = single; + irregularSingles[single] = pl; + irregularPlurals[pl] = single; }); -PLURALIZATION_RUES.forEach((rule) => addPluralRule(rule[0], rule[1])); +PLURALIZATION_RUES.forEach(rule => addPluralRule(rule[0], rule[1])); -SINGULARIZATION_RULES.forEach((rule) => addSingularRule(rule[0], rule[1])); +SINGULARIZATION_RULES.forEach(rule => addSingularRule(rule[0], rule[1])); -UNCOUNTABLE_RULES.forEach((word) => { +UNCOUNTABLE_RULES.forEach(word => { if (isString(word)) { uncountables[word.toLowerCase()] = true; diff --git a/src/string/pluralize/test.ts b/src/string/pluralize/test.ts index 32ebaaf8..dd189642 100644 --- a/src/string/pluralize/test.ts +++ b/src/string/pluralize/test.ts @@ -1,4 +1,4 @@ -import "./index"; +import "."; /** * Standard singular/plural matches. @@ -8,156 +8,607 @@ import "./index"; */ const BASIC_TESTS = [ // Uncountables. - ["fish", "fish"], ["media", "media"], ["moose", "moose"], ["police", "police"], ["sheep", "sheep"], - ["series", "series"], ["species", "species"], ["agenda", "agenda"], ["news", "news"], - ["reindeer", "reindeer"], ["starfish", "starfish"], ["smallpox", "smallpox"], ["tennis", "tennis"], - ["chickenpox", "chickenpox"], ["shambles", "shambles"], ["garbage", "garbage"], ["you", "you"], - ["wildlife", "wildlife"], ["Staff", "Staff"], ["STAFF", "STAFF"], ["turquois", "turquois"], + ["fish", "fish"], + ["media", "media"], + ["moose", "moose"], + ["police", "police"], + ["sheep", "sheep"], + ["series", "series"], + ["species", "species"], + ["agenda", "agenda"], + ["news", "news"], + ["reindeer", "reindeer"], + ["starfish", "starfish"], + ["smallpox", "smallpox"], + ["tennis", "tennis"], + ["chickenpox", "chickenpox"], + ["shambles", "shambles"], + ["garbage", "garbage"], + ["you", "you"], + ["wildlife", "wildlife"], + ["Staff", "Staff"], + ["STAFF", "STAFF"], + ["turquois", "turquois"], ["carnivorous", "carnivorous"], // Latin. ["veniam", "veniam"], // Pluralization. - ["this", "these"], ["that", "those"], ["is", "are"], ["man", "men"], ["superman", "supermen"], - ["ox", "oxen"], ["bus", "buses"], ["airbus", "airbuses"], ["railbus", "railbuses"], ["wife", "wives"], - ["guest", "guests"], ["thing", "things"], ["mess", "messes"], ["guess", "guesses"], ["person", "people"], - ["meteor", "meteors"], ["chateau", "chateaus"], ["lap", "laps"], ["cough", "coughs"], ["death", "deaths"], - ["coach", "coaches"], ["boy", "boys"], ["toy", "toys"], ["guy", "guys"], ["girl", "girls"], - ["chair", "chairs"], ["toe", "toes"], ["tiptoe", "tiptoes"], ["tomato", "tomatoes"], - ["potato", "potatoes"], ["tornado", "tornadoes"], ["torpedo", "torpedoes"], ["hero", "heroes"], - ["superhero", "superheroes"], ["volcano", "volcanoes"], ["canto", "cantos"], ["hetero", "heteros"], - ["photo", "photos"], ["portico", "porticos"], ["quarto", "quartos"], ["kimono", "kimonos"], - ["albino", "albinos"], ["cherry", "cherries"], ["piano", "pianos"], ["pro", "pros"], ["combo", "combos"], - ["turbo", "turbos"], ["bar", "bars"], ["crowbar", "crowbars"], ["van", "vans"], ["tobacco", "tobaccos"], - ["afficionado", "afficionados"], ["monkey", "monkeys"], ["neutrino", "neutrinos"], ["rhino", "rhinos"], - ["steno", "stenos"], ["latino", "latinos"], ["casino", "casinos"], ["avocado", "avocados"], - ["commando", "commandos"], ["tuxedo", "tuxedos"], ["speedo", "speedos"], ["dingo", "dingoes"], - ["echo", "echoes"], ["nacho", "nachos"], ["motto", "mottos"], ["psycho", "psychos"], ["poncho", "ponchos"], - ["pass", "passes"], ["ghetto", "ghettos"], ["mango", "mangos"], ["lady", "ladies"], ["bath", "baths"], + ["this", "these"], + ["that", "those"], + ["is", "are"], + ["man", "men"], + ["superman", "supermen"], + ["ox", "oxen"], + ["bus", "buses"], + ["airbus", "airbuses"], + ["railbus", "railbuses"], + ["wife", "wives"], + ["guest", "guests"], + ["thing", "things"], + ["mess", "messes"], + ["guess", "guesses"], + ["person", "people"], + ["meteor", "meteors"], + ["chateau", "chateaus"], + ["lap", "laps"], + ["cough", "coughs"], + ["death", "deaths"], + ["coach", "coaches"], + ["boy", "boys"], + ["toy", "toys"], + ["guy", "guys"], + ["girl", "girls"], + ["chair", "chairs"], + ["toe", "toes"], + ["tiptoe", "tiptoes"], + ["tomato", "tomatoes"], + ["potato", "potatoes"], + ["tornado", "tornadoes"], + ["torpedo", "torpedoes"], + ["hero", "heroes"], + ["superhero", "superheroes"], + ["volcano", "volcanoes"], + ["canto", "cantos"], + ["hetero", "heteros"], + ["photo", "photos"], + ["portico", "porticos"], + ["quarto", "quartos"], + ["kimono", "kimonos"], + ["albino", "albinos"], + ["cherry", "cherries"], + ["piano", "pianos"], + ["pro", "pros"], + ["combo", "combos"], + ["turbo", "turbos"], + ["bar", "bars"], + ["crowbar", "crowbars"], + ["van", "vans"], + ["tobacco", "tobaccos"], + ["afficionado", "afficionados"], + ["monkey", "monkeys"], + ["neutrino", "neutrinos"], + ["rhino", "rhinos"], + ["steno", "stenos"], + ["latino", "latinos"], + ["casino", "casinos"], + ["avocado", "avocados"], + ["commando", "commandos"], + ["tuxedo", "tuxedos"], + ["speedo", "speedos"], + ["dingo", "dingoes"], + ["echo", "echoes"], + ["nacho", "nachos"], + ["motto", "mottos"], + ["psycho", "psychos"], + ["poncho", "ponchos"], + ["pass", "passes"], + ["ghetto", "ghettos"], + ["mango", "mangos"], + ["lady", "ladies"], + ["bath", "baths"], ["professional", "professionals"], ["dwarf", "dwarves"], // Proper spelling is "dwarfs". - ["encyclopedia", "encyclopedias"], ["louse", "lice"], ["roof", "roofs"], ["woman", "women"], - ["formula", "formulas"], ["polyhedron", "polyhedra"], + ["encyclopedia", "encyclopedias"], + ["louse", "lice"], + ["roof", "roofs"], + ["woman", "women"], + ["formula", "formulas"], + ["polyhedron", "polyhedra"], ["index", "indices"], // Maybe "indexes". - ["matrix", "matrices"], ["vertex", "vertices"], + ["matrix", "matrices"], + ["vertex", "vertices"], ["axe", "axes"], // Could also be plural of "ax". - ["pickaxe", "pickaxes"], ["crisis", "crises"], ["criterion", "criteria"], ["phenomenon", "phenomena"], - ["addendum", "addenda"], ["datum", "data"], ["forum", "forums"], ["millennium", "millennia"], - ["alumnus", "alumni"], ["medium", "mediums"], ["census", "censuses"], ["genus", "genera"], - ["dogma", "dogmata"], ["life", "lives"], ["hive", "hives"], ["kiss", "kisses"], ["dish", "dishes"], - ["human", "humans"], ["knife", "knives"], ["phase", "phases"], ["judge", "judges"], ["class", "classes"], - ["witch", "witches"], ["church", "churches"], ["massage", "massages"], ["prospectus", "prospectuses"], - ["syllabus", "syllabi"], ["viscus", "viscera"], ["cactus", "cacti"], ["hippopotamus", "hippopotamuses"], - ["octopus", "octopi"], ["platypus", "platypuses"], ["kangaroo", "kangaroos"], ["atlas", "atlases"], - ["stigma", "stigmata"], ["schema", "schemata"], ["phenomenon", "phenomena"], ["diagnosis", "diagnoses"], - ["mongoose", "mongooses"], ["mouse", "mice"], ["liturgist", "liturgists"], ["box", "boxes"], - ["gas", "gases"], ["self", "selves"], ["chief", "chiefs"], ["quiz", "quizzes"], ["child", "children"], - ["shelf", "shelves"], ["fizz", "fizzes"], ["tooth", "teeth"], ["thief", "thieves"], ["day", "days"], - ["loaf", "loaves"], ["fix", "fixes"], ["spy", "spies"], ["vertebra", "vertebrae"], ["clock", "clocks"], - ["lap", "laps"], ["cuff", "cuffs"], ["leaf", "leaves"], ["calf", "calves"], ["moth", "moths"], - ["mouth", "mouths"], ["house", "houses"], ["proof", "proofs"], ["hoof", "hooves"], ["elf", "elves"], - ["turf", "turfs"], ["craft", "crafts"], ["die", "dice"], ["penny", "pennies"], ["campus", "campuses"], - ["virus", "viri"], ["iris", "irises"], ["bureau", "bureaus"], ["kiwi", "kiwis"], ["wiki", "wikis"], - ["igloo", "igloos"], ["ninja", "ninjas"], ["pizza", "pizzas"], ["kayak", "kayaks"], ["canoe", "canoes"], - ["tiding", "tidings"], ["pea", "peas"], ["drive", "drives"], ["nose", "noses"], ["movie", "movies"], - ["status", "statuses"], ["alias", "aliases"], ["memorandum", "memorandums"], ["language", "languages"], - ["plural", "plurals"], ["word", "words"], ["multiple", "multiples"], ["reward", "rewards"], - ["sandwich", "sandwiches"], ["subway", "subways"], ["direction", "directions"], ["land", "lands"], - ["row", "rows"], ["grow", "grows"], ["flow", "flows"], ["rose", "roses"], ["raise", "raises"], - ["friend", "friends"], ["follower", "followers"], ["male", "males"], ["nail", "nails"], ["sex", "sexes"], - ["tape", "tapes"], ["ruler", "rulers"], ["king", "kings"], ["queen", "queens"], ["zero", "zeros"], - ["quest", "quests"], ["goose", "geese"], ["foot", "feet"], ["ex", "exes"], ["reflex", "reflexes"], - ["heat", "heats"], ["train", "trains"], ["test", "tests"], ["pie", "pies"], ["fly", "flies"], - ["eye", "eyes"], ["lie", "lies"], ["node", "nodes"], ["trade", "trades"], ["chinese", "chinese"], - ["please", "pleases"], ["japanese", "japanese"], ["regex", "regexes"], ["license", "licenses"], - ["zebra", "zebras"], ["general", "generals"], ["corps", "corps"], ["pliers", "pliers"], - ["flyer", "flyers"], ["scissors", "scissors"], ["fireman", "firemen"], ["chirp", "chirps"], - ["harp", "harps"], ["corpse", "corpses"], ["dye", "dyes"], ["move", "moves"], ["zombie", "zombies"], - ["variety", "varieties"], ["talkie", "talkies"], ["walkie-talkie", "walkie-talkies"], - ["groupie", "groupies"], ["goonie", "goonies"], ["lassie", "lassies"], ["genie", "genies"], - ["foodie", "foodies"], ["faerie", "faeries"], ["collie", "collies"], ["obloquy", "obloquies"], - ["looey", "looies"], ["osprey", "ospreys"], ["cover", "covers"], ["tie", "ties"], ["groove", "grooves"], - ["bee", "bees"], ["ave", "aves"], ["wave", "waves"], ["wolf", "wolves"], ["airwave", "airwaves"], - ["archive", "archives"], ["arch", "arches"], ["dive", "dives"], ["aftershave", "aftershaves"], - ["cave", "caves"], ["grave", "graves"], ["gift", "gifts"], ["nerve", "nerves"], ["nerd", "nerds"], - ["carve", "carves"], ["rave", "raves"], ["scarf", "scarves"], ["sale", "sales"], ["sail", "sails"], - ["swerve", "swerves"], ["love", "loves"], ["dove", "doves"], ["glove", "gloves"], ["wharf", "wharves"], - ["valve", "valves"], ["werewolf", "werewolves"], ["view", "views"], ["emu", "emus"], ["menu", "menus"], - ["wax", "waxes"], ["fax", "faxes"], ["nut", "nuts"], ["crust", "crusts"], ["lemma", "lemmata"], - ["anathema", "anathemata"], ["analysis", "analyses"], ["locus", "loci"], ["uterus", "uteri"], - ["curriculum", "curricula"], ["quorum", "quora"], ["genie", "genies"], ["genius", "geniuses"], - ["flower", "flowers"], ["crash", "crashes"], ["soul", "souls"], ["career", "careers"], - ["planet", "planets"], ["son", "sons"], ["sun", "suns"], ["drink", "drinks"], ["diploma", "diplomas"], - ["dilemma", "dilemmas"], ["grandma", "grandmas"], ["no", "nos"], ["yes", "yeses"], ["employ", "employs"], - ["employee", "employees"], ["history", "histories"], ["story", "stories"], ["purchase", "purchases"], - ["order", "orders"], ["key", "keys"], ["bomb", "bombs"], ["city", "cities"], ["sanity", "sanities"], - ["ability", "abilities"], ["activity", "activities"], ["cutie", "cuties"], ["validation", "validations"], - ["floaty", "floaties"], ["nicety", "niceties"], ["goalie", "goalies"], ["crawly", "crawlies"], - ["duty", "duties"], ["scrutiny", "scrutinies"], ["deputy", "deputies"], ["beauty", "beauties"], - ["bank", "banks"], ["family", "families"], ["tally", "tallies"], ["ally", "allies"], ["alley", "alleys"], - ["valley", "valleys"], ["medley", "medleys"], ["melody", "melodies"], ["trolly", "trollies"], - ["thunk", "thunks"], ["koala", "koalas"], ["special", "specials"], ["book", "books"], ["knob", "knobs"], - ["crab", "crabs"], ["plough", "ploughs"], ["high", "highs"], ["low", "lows"], ["hiccup", "hiccups"], - ["bonus", "bonuses"], ["circus", "circuses"], ["abacus", "abacuses"], ["phobia", "phobias"], - ["case", "cases"], ["lace", "laces"], ["trace", "traces"], ["mage", "mages"], ["lotus", "lotuses"], - ["motorbus", "motorbuses"], ["cutlas", "cutlases"], ["tequila", "tequilas"], ["liar", "liars"], - ["delta", "deltas"], ["visa", "visas"], ["flea", "fleas"], ["favela", "favelas"], ["cobra", "cobras"], - ["finish", "finishes"], ["gorilla", "gorillas"], ["mass", "masses"], ["face", "faces"], - ["rabbit", "rabbits"], ["adventure", "adventures"], ["breeze", "breezes"], ["brew", "brews"], - ["canopy", "canopies"], ["copy", "copies"], ["spy", "spies"], ["cave", "caves"], ["charge", "charges"], - ["cinema", "cinemas"], ["coffee", "coffees"], ["favourite", "favourites"], ["themself", "themselves"], - ["country", "countries"], ["issue", "issues"], ["authority", "authorities"], ["force", "forces"], - ["objective", "objectives"], ["present", "presents"], ["industry", "industries"], ["believe", "believes"], - ["century", "centuries"], ["category", "categories"], ["eve", "eves"], ["fee", "fees"], ["gene", "genes"], - ["try", "tries"], ["currency", "currencies"], ["pose", "poses"], ["cheese", "cheeses"], ["clue", "clues"], - ["cheer", "cheers"], ["litre", "litres"], ["money", "monies"], ["attorney", "attorneys"], - ["balcony", "balconies"], ["cockney", "cockneys"], ["donkey", "donkeys"], ["honey", "honeys"], - ["smiley", "smilies"], ["survey", "surveys"], ["whiskey", "whiskies"], ["volley", "volleys"], - ["tongue", "tongues"], ["suit", "suits"], ["suite", "suites"], ["cruise", "cruises"], ["eave", "eaves"], - ["consultancy", "consultancies"], ["pouch", "pouches"], ["wallaby", "wallabies"], ["abyss", "abysses"], - ["weekly", "weeklies"], ["whistle", "whistles"], ["utilise", "utilises"], ["utilize", "utilizes"], - ["mercy", "mercies"], ["mercenary", "mercenaries"], ["take", "takes"], ["flush", "flushes"], - ["gate", "gates"], ["evolve", "evolves"], ["slave", "slaves"], ["native", "natives"], - ["revolve", "revolves"], ["twelve", "twelves"], ["sleeve", "sleeves"], ["subjective", "subjectives"], - ["stream", "streams"], ["beam", "beams"], ["foam", "foams"], ["callus", "calluses"], ["use", "uses"], - ["beau", "beaus"], ["gateau", "gateaus"], ["fetus", "fetuses"], ["luau", "luaus"], ["pilau", "pilaus"], - ["shoe", "shoes"], ["sandshoe", "sandshoes"], ["zeus", "zeuses"], ["nucleus", "nuclei"], ["sky", "skies"], - ["beach", "beaches"], ["brush", "brushes"], ["hoax", "hoaxes"], ["scratch", "scratches"], - ["nanny", "nannies"], ["negro", "negroes"], ["taco", "tacos"], ["cafe", "cafes"], ["cave", "caves"], - ["giraffe", "giraffes"], ["goodwife", "goodwives"], ["housewife", "housewives"], ["safe", "safes"], - ["save", "saves"], ["pocketknife", "pocketknives"], ["tartufe", "tartufes"], ["tartuffe", "tartuffes"], - ["truffle", "truffles"], ["jefe", "jefes"], ["agrafe", "agrafes"], ["agraffe", "agraffes"], - ["bouffe", "bouffes"], ["carafe", "carafes"], ["chafe", "chafes"], ["pouffe", "pouffes"], - ["pouf", "poufs"], ["piaffe", "piaffes"], ["gaffe", "gaffes"], ["executive", "executives"], - ["cove", "coves"], ["dove", "doves"], ["fave", "faves"], ["positive", "positives"], ["solve", "solves"], - ["trove", "troves"], ["treasure", "treasures"], ["suave", "suaves"], ["bluff", "bluffs"], - ["half", "halves"], ["knockoff", "knockoffs"], ["handkerchief", "handkerchiefs"], ["reed", "reeds"], - ["reef", "reefs"], ["yourself", "yourselves"], ["sunroof", "sunroofs"], ["plateau", "plateaus"], - ["radius", "radii"], ["stratum", "strata"], ["stratus", "strati"], ["focus", "foci"], ["fungus", "fungi"], - ["appendix", "appendices"], ["seraph", "seraphim"], ["cherub", "cherubim"], ["memo", "memos"], - ["cello", "cellos"], ["automaton", "automata"], ["button", "buttons"], ["crayon", "crayons"], - ["captive", "captives"], ["abrasive", "abrasives"], ["archive", "archives"], ["additive", "additives"], - ["hive", "hives"], ["beehive", "beehives"], ["olive", "olives"], ["black olive", "black olives"], - ["chive", "chives"], ["adjective", "adjectives"], ["cattle drive", "cattle drives"], - ["explosive", "explosives"], ["executive", "executives"], ["negative", "negatives"], - ["fugitive", "fugitives"], ["progressive", "progressives"], ["laxative", "laxatives"], - ["incentive", "incentives"], ["relative", "relatives"], ["positive", "positives"], - ["perspective", "perspectives"], ["superlative", "superlatives"], ["afterlife", "afterlives"], - ["native", "natives"], ["detective", "detectives"], ["collective", "collectives"], - ["lowlife", "lowlives"], ["low-life", "low-lives"], ["strife", "strifes"], ["pony", "ponies"], - ["phony", "phonies"], ["felony", "felonies"], ["colony", "colonies"], ["symphony", "symphonies"], - ["semicolony", "semicolonies"], ["radiotelephony", "radiotelephonies"], ["company", "companies"], - ["ceremony", "ceremonies"], ["carnivore", "carnivores"], ["emphasis", "emphases"], ["abuse", "abuses"], - ["ass", "asses"], ["mile", "miles"], ["consensus", "consensuses"], ["coatdress", "coatdresses"], - ["courthouse", "courthouses"], ["playhouse", "playhouses"], ["crispness", "crispnesses"], - ["racehorse", "racehorses"], ["greatness", "greatnesses"], ["christmas", "christmases"], - ["zymase", "zymases"], ["accomplice", "accomplices"], ["amice", "amices"], ["titmouse", "titmice"], + ["pickaxe", "pickaxes"], + ["crisis", "crises"], + ["criterion", "criteria"], + ["phenomenon", "phenomena"], + ["addendum", "addenda"], + ["datum", "data"], + ["forum", "forums"], + ["millennium", "millennia"], + ["alumnus", "alumni"], + ["medium", "mediums"], + ["census", "censuses"], + ["genus", "genera"], + ["dogma", "dogmata"], + ["life", "lives"], + ["hive", "hives"], + ["kiss", "kisses"], + ["dish", "dishes"], + ["human", "humans"], + ["knife", "knives"], + ["phase", "phases"], + ["judge", "judges"], + ["class", "classes"], + ["witch", "witches"], + ["church", "churches"], + ["massage", "massages"], + ["prospectus", "prospectuses"], + ["syllabus", "syllabi"], + ["viscus", "viscera"], + ["cactus", "cacti"], + ["hippopotamus", "hippopotamuses"], + ["octopus", "octopi"], + ["platypus", "platypuses"], + ["kangaroo", "kangaroos"], + ["atlas", "atlases"], + ["stigma", "stigmata"], + ["schema", "schemata"], + ["phenomenon", "phenomena"], + ["diagnosis", "diagnoses"], + ["mongoose", "mongooses"], + ["mouse", "mice"], + ["liturgist", "liturgists"], + ["box", "boxes"], + ["gas", "gases"], + ["self", "selves"], + ["chief", "chiefs"], + ["quiz", "quizzes"], + ["child", "children"], + ["shelf", "shelves"], + ["fizz", "fizzes"], + ["tooth", "teeth"], + ["thief", "thieves"], + ["day", "days"], + ["loaf", "loaves"], + ["fix", "fixes"], + ["spy", "spies"], + ["vertebra", "vertebrae"], + ["clock", "clocks"], + ["lap", "laps"], + ["cuff", "cuffs"], + ["leaf", "leaves"], + ["calf", "calves"], + ["moth", "moths"], + ["mouth", "mouths"], + ["house", "houses"], + ["proof", "proofs"], + ["hoof", "hooves"], + ["elf", "elves"], + ["turf", "turfs"], + ["craft", "crafts"], + ["die", "dice"], + ["penny", "pennies"], + ["campus", "campuses"], + ["virus", "viri"], + ["iris", "irises"], + ["bureau", "bureaus"], + ["kiwi", "kiwis"], + ["wiki", "wikis"], + ["igloo", "igloos"], + ["ninja", "ninjas"], + ["pizza", "pizzas"], + ["kayak", "kayaks"], + ["canoe", "canoes"], + ["tiding", "tidings"], + ["pea", "peas"], + ["drive", "drives"], + ["nose", "noses"], + ["movie", "movies"], + ["status", "statuses"], + ["alias", "aliases"], + ["memorandum", "memorandums"], + ["language", "languages"], + ["plural", "plurals"], + ["word", "words"], + ["multiple", "multiples"], + ["reward", "rewards"], + ["sandwich", "sandwiches"], + ["subway", "subways"], + ["direction", "directions"], + ["land", "lands"], + ["row", "rows"], + ["grow", "grows"], + ["flow", "flows"], + ["rose", "roses"], + ["raise", "raises"], + ["friend", "friends"], + ["follower", "followers"], + ["male", "males"], + ["nail", "nails"], + ["sex", "sexes"], + ["tape", "tapes"], + ["ruler", "rulers"], + ["king", "kings"], + ["queen", "queens"], + ["zero", "zeros"], + ["quest", "quests"], + ["goose", "geese"], + ["foot", "feet"], + ["ex", "exes"], + ["reflex", "reflexes"], + ["heat", "heats"], + ["train", "trains"], + ["test", "tests"], + ["pie", "pies"], + ["fly", "flies"], + ["eye", "eyes"], + ["lie", "lies"], + ["node", "nodes"], + ["trade", "trades"], + ["chinese", "chinese"], + ["please", "pleases"], + ["japanese", "japanese"], + ["regex", "regexes"], + ["license", "licenses"], + ["zebra", "zebras"], + ["general", "generals"], + ["corps", "corps"], + ["pliers", "pliers"], + ["flyer", "flyers"], + ["scissors", "scissors"], + ["fireman", "firemen"], + ["chirp", "chirps"], + ["harp", "harps"], + ["corpse", "corpses"], + ["dye", "dyes"], + ["move", "moves"], + ["zombie", "zombies"], + ["variety", "varieties"], + ["talkie", "talkies"], + ["walkie-talkie", "walkie-talkies"], + ["groupie", "groupies"], + ["goonie", "goonies"], + ["lassie", "lassies"], + ["genie", "genies"], + ["foodie", "foodies"], + ["faerie", "faeries"], + ["collie", "collies"], + ["obloquy", "obloquies"], + ["looey", "looies"], + ["osprey", "ospreys"], + ["cover", "covers"], + ["tie", "ties"], + ["groove", "grooves"], + ["bee", "bees"], + ["ave", "aves"], + ["wave", "waves"], + ["wolf", "wolves"], + ["airwave", "airwaves"], + ["archive", "archives"], + ["arch", "arches"], + ["dive", "dives"], + ["aftershave", "aftershaves"], + ["cave", "caves"], + ["grave", "graves"], + ["gift", "gifts"], + ["nerve", "nerves"], + ["nerd", "nerds"], + ["carve", "carves"], + ["rave", "raves"], + ["scarf", "scarves"], + ["sale", "sales"], + ["sail", "sails"], + ["swerve", "swerves"], + ["love", "loves"], + ["dove", "doves"], + ["glove", "gloves"], + ["wharf", "wharves"], + ["valve", "valves"], + ["werewolf", "werewolves"], + ["view", "views"], + ["emu", "emus"], + ["menu", "menus"], + ["wax", "waxes"], + ["fax", "faxes"], + ["nut", "nuts"], + ["crust", "crusts"], + ["lemma", "lemmata"], + ["anathema", "anathemata"], + ["analysis", "analyses"], + ["locus", "loci"], + ["uterus", "uteri"], + ["curriculum", "curricula"], + ["quorum", "quora"], + ["genie", "genies"], + ["genius", "geniuses"], + ["flower", "flowers"], + ["crash", "crashes"], + ["soul", "souls"], + ["career", "careers"], + ["planet", "planets"], + ["son", "sons"], + ["sun", "suns"], + ["drink", "drinks"], + ["diploma", "diplomas"], + ["dilemma", "dilemmas"], + ["grandma", "grandmas"], + ["no", "nos"], + ["yes", "yeses"], + ["employ", "employs"], + ["employee", "employees"], + ["history", "histories"], + ["story", "stories"], + ["purchase", "purchases"], + ["order", "orders"], + ["key", "keys"], + ["bomb", "bombs"], + ["city", "cities"], + ["sanity", "sanities"], + ["ability", "abilities"], + ["activity", "activities"], + ["cutie", "cuties"], + ["validation", "validations"], + ["floaty", "floaties"], + ["nicety", "niceties"], + ["goalie", "goalies"], + ["crawly", "crawlies"], + ["duty", "duties"], + ["scrutiny", "scrutinies"], + ["deputy", "deputies"], + ["beauty", "beauties"], + ["bank", "banks"], + ["family", "families"], + ["tally", "tallies"], + ["ally", "allies"], + ["alley", "alleys"], + ["valley", "valleys"], + ["medley", "medleys"], + ["melody", "melodies"], + ["trolly", "trollies"], + ["thunk", "thunks"], + ["koala", "koalas"], + ["special", "specials"], + ["book", "books"], + ["knob", "knobs"], + ["crab", "crabs"], + ["plough", "ploughs"], + ["high", "highs"], + ["low", "lows"], + ["hiccup", "hiccups"], + ["bonus", "bonuses"], + ["circus", "circuses"], + ["abacus", "abacuses"], + ["phobia", "phobias"], + ["case", "cases"], + ["lace", "laces"], + ["trace", "traces"], + ["mage", "mages"], + ["lotus", "lotuses"], + ["motorbus", "motorbuses"], + ["cutlas", "cutlases"], + ["tequila", "tequilas"], + ["liar", "liars"], + ["delta", "deltas"], + ["visa", "visas"], + ["flea", "fleas"], + ["favela", "favelas"], + ["cobra", "cobras"], + ["finish", "finishes"], + ["gorilla", "gorillas"], + ["mass", "masses"], + ["face", "faces"], + ["rabbit", "rabbits"], + ["adventure", "adventures"], + ["breeze", "breezes"], + ["brew", "brews"], + ["canopy", "canopies"], + ["copy", "copies"], + ["spy", "spies"], + ["cave", "caves"], + ["charge", "charges"], + ["cinema", "cinemas"], + ["coffee", "coffees"], + ["favourite", "favourites"], + ["themself", "themselves"], + ["country", "countries"], + ["issue", "issues"], + ["authority", "authorities"], + ["force", "forces"], + ["objective", "objectives"], + ["present", "presents"], + ["industry", "industries"], + ["believe", "believes"], + ["century", "centuries"], + ["category", "categories"], + ["eve", "eves"], + ["fee", "fees"], + ["gene", "genes"], + ["try", "tries"], + ["currency", "currencies"], + ["pose", "poses"], + ["cheese", "cheeses"], + ["clue", "clues"], + ["cheer", "cheers"], + ["litre", "litres"], + ["money", "monies"], + ["attorney", "attorneys"], + ["balcony", "balconies"], + ["cockney", "cockneys"], + ["donkey", "donkeys"], + ["honey", "honeys"], + ["smiley", "smilies"], + ["survey", "surveys"], + ["whiskey", "whiskies"], + ["volley", "volleys"], + ["tongue", "tongues"], + ["suit", "suits"], + ["suite", "suites"], + ["cruise", "cruises"], + ["eave", "eaves"], + ["consultancy", "consultancies"], + ["pouch", "pouches"], + ["wallaby", "wallabies"], + ["abyss", "abysses"], + ["weekly", "weeklies"], + ["whistle", "whistles"], + ["utilise", "utilises"], + ["utilize", "utilizes"], + ["mercy", "mercies"], + ["mercenary", "mercenaries"], + ["take", "takes"], + ["flush", "flushes"], + ["gate", "gates"], + ["evolve", "evolves"], + ["slave", "slaves"], + ["native", "natives"], + ["revolve", "revolves"], + ["twelve", "twelves"], + ["sleeve", "sleeves"], + ["subjective", "subjectives"], + ["stream", "streams"], + ["beam", "beams"], + ["foam", "foams"], + ["callus", "calluses"], + ["use", "uses"], + ["beau", "beaus"], + ["gateau", "gateaus"], + ["fetus", "fetuses"], + ["luau", "luaus"], + ["pilau", "pilaus"], + ["shoe", "shoes"], + ["sandshoe", "sandshoes"], + ["zeus", "zeuses"], + ["nucleus", "nuclei"], + ["sky", "skies"], + ["beach", "beaches"], + ["brush", "brushes"], + ["hoax", "hoaxes"], + ["scratch", "scratches"], + ["nanny", "nannies"], + ["negro", "negroes"], + ["taco", "tacos"], + ["cafe", "cafes"], + ["cave", "caves"], + ["giraffe", "giraffes"], + ["goodwife", "goodwives"], + ["housewife", "housewives"], + ["safe", "safes"], + ["save", "saves"], + ["pocketknife", "pocketknives"], + ["tartufe", "tartufes"], + ["tartuffe", "tartuffes"], + ["truffle", "truffles"], + ["jefe", "jefes"], + ["agrafe", "agrafes"], + ["agraffe", "agraffes"], + ["bouffe", "bouffes"], + ["carafe", "carafes"], + ["chafe", "chafes"], + ["pouffe", "pouffes"], + ["pouf", "poufs"], + ["piaffe", "piaffes"], + ["gaffe", "gaffes"], + ["executive", "executives"], + ["cove", "coves"], + ["dove", "doves"], + ["fave", "faves"], + ["positive", "positives"], + ["solve", "solves"], + ["trove", "troves"], + ["treasure", "treasures"], + ["suave", "suaves"], + ["bluff", "bluffs"], + ["half", "halves"], + ["knockoff", "knockoffs"], + ["handkerchief", "handkerchiefs"], + ["reed", "reeds"], + ["reef", "reefs"], + ["yourself", "yourselves"], + ["sunroof", "sunroofs"], + ["plateau", "plateaus"], + ["radius", "radii"], + ["stratum", "strata"], + ["stratus", "strati"], + ["focus", "foci"], + ["fungus", "fungi"], + ["appendix", "appendices"], + ["seraph", "seraphim"], + ["cherub", "cherubim"], + ["memo", "memos"], + ["cello", "cellos"], + ["automaton", "automata"], + ["button", "buttons"], + ["crayon", "crayons"], + ["captive", "captives"], + ["abrasive", "abrasives"], + ["archive", "archives"], + ["additive", "additives"], + ["hive", "hives"], + ["beehive", "beehives"], + ["olive", "olives"], + ["black olive", "black olives"], + ["chive", "chives"], + ["adjective", "adjectives"], + ["cattle drive", "cattle drives"], + ["explosive", "explosives"], + ["executive", "executives"], + ["negative", "negatives"], + ["fugitive", "fugitives"], + ["progressive", "progressives"], + ["laxative", "laxatives"], + ["incentive", "incentives"], + ["relative", "relatives"], + ["positive", "positives"], + ["perspective", "perspectives"], + ["superlative", "superlatives"], + ["afterlife", "afterlives"], + ["native", "natives"], + ["detective", "detectives"], + ["collective", "collectives"], + ["lowlife", "lowlives"], + ["low-life", "low-lives"], + ["strife", "strifes"], + ["pony", "ponies"], + ["phony", "phonies"], + ["felony", "felonies"], + ["colony", "colonies"], + ["symphony", "symphonies"], + ["semicolony", "semicolonies"], + ["radiotelephony", "radiotelephonies"], + ["company", "companies"], + ["ceremony", "ceremonies"], + ["carnivore", "carnivores"], + ["emphasis", "emphases"], + ["abuse", "abuses"], + ["ass", "asses"], + ["mile", "miles"], + ["consensus", "consensuses"], + ["coatdress", "coatdresses"], + ["courthouse", "courthouses"], + ["playhouse", "playhouses"], + ["crispness", "crispnesses"], + ["racehorse", "racehorses"], + ["greatness", "greatnesses"], + ["christmas", "christmases"], + ["zymase", "zymases"], + ["accomplice", "accomplices"], + ["amice", "amices"], + ["titmouse", "titmice"], ["slice", "slices"], // Prototype inheritance. ["constructor", "constructors"], // Non-standard case. - ["randomWord", "randomWords"], ["camelCase", "camelCases"], ["PascalCase", "PascalCases"], - ["Alumnus", "Alumni"], ["CHICKEN", "CHICKENS"], ["日本語", "日本語"], ["한국", "한국"], - ["中文", "中文"], ["اللغة العربية", "اللغة العربية"], ["四 chicken", "四 chickens"], + ["randomWord", "randomWords"], + ["camelCase", "camelCases"], + ["PascalCase", "PascalCases"], + ["Alumnus", "Alumni"], + ["CHICKEN", "CHICKENS"], + ["日本語", "日本語"], + ["한국", "한국"], + ["中文", "中文"], + ["اللغة العربية", "اللغة العربية"], + ["四 chicken", "四 chickens"], ]; /** @@ -167,8 +618,13 @@ const BASIC_TESTS = [ * @type {Array} */ const SINGULAR_TESTS = [ - ["dingo", "dingos"], ["mango", "mangoes"], ["echo", "echos"], ["ghetto", "ghettoes"], - ["nucleus", "nucleuses"], ["bureau", "bureaux"], ["seraph", "seraphs"], + ["dingo", "dingos"], + ["mango", "mangoes"], + ["echo", "echos"], + ["ghetto", "ghettoes"], + ["nucleus", "nucleuses"], + ["bureau", "bureaux"], + ["seraph", "seraphs"], ]; /** @@ -178,14 +634,17 @@ const SINGULAR_TESTS = [ * @type {Array} */ const PLURAL_TESTS = [ - ["whisky", "whiskies"], ["plateaux", "plateaux"], ["axis", "axes"], ["automatum", "automata"], + ["whisky", "whiskies"], + ["plateaux", "plateaux"], + ["axis", "axes"], + ["automatum", "automata"], ["thou", "you"], ]; describe("String.prototype.pluralize", () => { describe("pluralize()", () => { - BASIC_TESTS.concat(PLURAL_TESTS).forEach((test) => { - it(test[0] + " -> " + test[1], () => { + BASIC_TESTS.concat(PLURAL_TESTS).forEach(test => { + it(`${test[0]} -> ${test[1]}`, () => { expect(test[0].pluralize()).toEqual(test[1]); }); }); @@ -193,32 +652,34 @@ describe("String.prototype.pluralize", () => { describe("automatically convert", () => { describe("pluralize(5)", () => { - BASIC_TESTS.concat(PLURAL_TESTS).forEach((test) => { + BASIC_TESTS.concat(PLURAL_TESTS).forEach(test => { // Make sure the word stays pluralized. - it("5 " + test[1] + " -> " + test[1], () => { + it(`5 ${test[1]} -> ${test[1]}`, () => { expect(test[1].pluralize(5)).toEqual(test[1]); }); // Make sure the word becomes a plural. - if (test[0] !== test[1]) - it("5 " + test[0] + " -> " + test[1], () => { + if (test[0] !== test[1]) { + it(`5 ${test[0]} -> ${test[1]}`, () => { expect(test[0].pluralize(5)).toEqual(test[1]); }); + } }); }); describe("pluralize(1)", () => { - BASIC_TESTS.concat(SINGULAR_TESTS).forEach((test) => { + BASIC_TESTS.concat(SINGULAR_TESTS).forEach(test => { // Make sure the word stays singular. - it("1 " + test[0] + " -> " + test[0], () => { + it(`1 ${test[0]} -> ${test[0]}`, () => { expect(test[0].pluralize(1)).toEqual(test[0]); }); // Make sure the word becomes singular. - if (test[0] !== test[1]) - it("1 " + test[1] + " -> " + test[0], () => { + if (test[0] !== test[1]) { + it(`1 ${test[1]} -> ${test[0]}`, () => { expect(test[1].pluralize(1)).toEqual(test[0]); }); + } }); }); }); diff --git a/src/string/reduce/index.ts b/src/string/reduce/index.ts index 0c350a53..40dac4d7 100644 --- a/src/string/reduce/index.ts +++ b/src/string/reduce/index.ts @@ -1,9 +1,12 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { - reduce(fn: (prev: T, char: string, index: number, chars: string[]) => T, initialValue?: T): any; + reduce( + fn: (prev: T, char: string, index: number, chars: string[]) => T, + initialValue?: T, + ): any; } } diff --git a/src/string/reduce/method.ts b/src/string/reduce/method.ts index 38f0e6e8..c788c00b 100644 --- a/src/string/reduce/method.ts +++ b/src/string/reduce/method.ts @@ -1,7 +1,7 @@ const method = ( str: string, fn: (prev: any, char: string, index: number, chars: string[]) => any, - initialValue: any = undefined + initialValue: any = undefined, ) => str.split("").reduce(fn, initialValue); export = method; diff --git a/src/string/reduce/test.ts b/src/string/reduce/test.ts index d396894c..ede8fca2 100644 --- a/src/string/reduce/test.ts +++ b/src/string/reduce/test.ts @@ -1,11 +1,11 @@ -import "./index"; +import "."; describe("String.prototype.reduce", () => { test("'123'.reduce((prev, char) => prev + (+char), 0) returns 6", () => { - expect("123".reduce((prev, char) => prev + (+char), 0)).toBe(6); + expect("123".reduce((prev, char) => prev + +char, 0)).toBe(6); }); test("'123'.reduce((prev = 0, char) => prev + (+char)) returns 6", () => { - expect("123".reduce((prev = 0, char) => prev + (+char))).toBe(6); + expect("123".reduce((prev = 0, char) => prev + +char)).toBe(6); }); }); diff --git a/src/string/repeat/index.ts b/src/string/repeat/index.ts index e7ca9ba6..2b750298 100644 --- a/src/string/repeat/index.ts +++ b/src/string/repeat/index.ts @@ -1,4 +1,4 @@ -import * as method from "./method"; +import method from "./method"; declare global { interface StringConstructor { diff --git a/src/string/repeat/method.ts b/src/string/repeat/method.ts index 570bd94b..9e12bb08 100644 --- a/src/string/repeat/method.ts +++ b/src/string/repeat/method.ts @@ -1,3 +1,6 @@ -const method = (n: number, value = " "): string => Array(n).fill(value).join(""); +const method = (n: number, value = " "): string => + Array(n) + .fill(value) + .join(""); export = method; diff --git a/src/string/repeat/test.ts b/src/string/repeat/test.ts index 74057239..e3157719 100644 --- a/src/string/repeat/test.ts +++ b/src/string/repeat/test.ts @@ -1,11 +1,11 @@ -import "./index"; +import "."; describe("String.repeat", () => { - test("String.repeat(5, \"2\") returns \"22222\"", () => { + test('String.repeat(5, "2") returns "22222"', () => { expect(String.repeat(5, "2")).toEqual("22222"); }); - test("String.repeat(2) returns \" \"", () => { + test('String.repeat(2) returns " "', () => { expect(String.repeat(2)).toEqual(" "); }); }); diff --git a/src/string/reverse/index.ts b/src/string/reverse/index.ts index 9a00c71f..d836c6e5 100644 --- a/src/string/reverse/index.ts +++ b/src/string/reverse/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/reverse/test.ts b/src/string/reverse/test.ts index d6f82cfa..f27a106c 100644 --- a/src/string/reverse/test.ts +++ b/src/string/reverse/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("String.prototype.reverse", () => { - test("\"foobar\".reverse() returns \"raboof\"", () => { - expect("foobar".reverse()) - .toBe("raboof"); + test('"foobar".reverse() returns "raboof"', () => { + expect("foobar".reverse()).toBe("raboof"); }); }); diff --git a/src/string/snakeCase/index.ts b/src/string/snakeCase/index.ts index dae26d77..5ef9eaea 100644 --- a/src/string/snakeCase/index.ts +++ b/src/string/snakeCase/index.ts @@ -1,5 +1,6 @@ -import * as method from "./method"; +// tslint:disable: max-line-length import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/snakeCase/method.ts b/src/string/snakeCase/method.ts index 0ef626f1..691dc536 100644 --- a/src/string/snakeCase/method.ts +++ b/src/string/snakeCase/method.ts @@ -1,5 +1,10 @@ -const method = (str: string): string => ( - str.match(/[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+|[A-Z]|[0-9]+/g) || [""] -).map((x) => x.toLowerCase()).join("_"); +const method = (str: string): string => + ( + str.match( + /[A-Z]{2,}(?=[A-Z][a-z]+[0-9]*|\b)|[A-Z]?[a-z]+|[A-Z]|[0-9]+/g, + ) || [""] + ) + .map(x => x.toLowerCase()) + .join("_"); export = method; diff --git a/src/string/snakeCase/test.ts b/src/string/snakeCase/test.ts index f7725dd9..b763c36b 100644 --- a/src/string/snakeCase/test.ts +++ b/src/string/snakeCase/test.ts @@ -1,44 +1,43 @@ -import "./index"; +import "."; describe("String.prototype.snakeCase", () => { - test("\"camelCase\".snakeCase() returns \"camel_case\"", () => { - expect("camelCase".snakeCase()) - .toBe("camel_case"); + test('"camelCase".snakeCase() returns "camel_case"', () => { + expect("camelCase".snakeCase()).toBe("camel_case"); }); - test("\"some text\".snakeCase() returns \"some_text\"", () => { - expect("some text".snakeCase()) - .toBe("some_text"); + test('"some text".snakeCase() returns "some_text"', () => { + expect("some text".snakeCase()).toBe("some_text"); }); test( - "\"some-mixed_string With spaces_underscores-and-hyphens\".snakeCase() returns " + - "\"some_mixed_string_with_spaces_underscores_and_hyphens\"", + '"some-mixed_string With spaces_underscores-and-hyphens".snakeCase() returns ' + + '"some_mixed_string_with_spaces_underscores_and_hyphens"', () => { - expect("some-mixed_string With spaces_underscores-and-hyphens".snakeCase()) - .toBe("some_mixed_string_with_spaces_underscores_and_hyphens"); - }); + expect( + "some-mixed_string With spaces_underscores-and-hyphens".snakeCase(), + ).toBe("some_mixed_string_with_spaces_underscores_and_hyphens"); + }, + ); - test("\"AllThe-small Things\".snakeCase() returns \"all_the_small_things\"", () => { - expect("AllThe-small Things".snakeCase()) - .toBe("all_the_small_things"); + test('"AllThe-small Things".snakeCase() returns "all_the_small_things"', () => { + expect("AllThe-small Things".snakeCase()).toBe("all_the_small_things"); }); - test( - "\"IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML\".snakeCase() returns " + - "\"i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html\"", - () => { - expect("IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML".snakeCase()) - .toBe("i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html"); - }); + test(// tslint:disable-next-line: max-line-length + '"IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML".snakeCase() returns "i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html"', () => { + expect( + "IAmListeningToFMWhileLoadingDifferentURLOnMyBrowserAndAlsoEditingSomeXMLAndHTML".snakeCase(), + ).toBe( + // tslint:disable-next-line: max-line-length + "i_am_listening_to_fm_while_loading_different_url_on_my_browser_and_also_editing_some_xml_and_html", + ); + }); - test("\"foo-Bar22\".snakeCase() returns \"foo_bar_22\"", () => { - expect("foo-Bar22".snakeCase()) - .toBe("foo_bar_22"); + test('"foo-Bar22".snakeCase() returns "foo_bar_22"', () => { + expect("foo-Bar22".snakeCase()).toBe("foo_bar_22"); }); - test("\"\".snakeCase() returns \"\"", () => { - expect("".snakeCase()) - .toBe(""); + test('"".snakeCase() returns ""', () => { + expect("".snakeCase()).toBe(""); }); }); diff --git a/src/string/swapCase/index.ts b/src/string/swapCase/index.ts index 511d37ea..d8562239 100644 --- a/src/string/swapCase/index.ts +++ b/src/string/swapCase/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/swapCase/method.ts b/src/string/swapCase/method.ts index f16d609c..eaa47fef 100644 --- a/src/string/swapCase/method.ts +++ b/src/string/swapCase/method.ts @@ -1,3 +1,6 @@ -const method = (str: string) => str.replace(/\S/g, (c) => c === c.toUpperCase() ? c.toLowerCase() : c.toUpperCase()); +const method = (str: string) => + str.replace(/\S/g, c => + c === c.toUpperCase() ? c.toLowerCase() : c.toUpperCase(), + ); export = method; diff --git a/src/string/swapCase/test.ts b/src/string/swapCase/test.ts index c9e85aa2..4e4486dd 100644 --- a/src/string/swapCase/test.ts +++ b/src/string/swapCase/test.ts @@ -1,8 +1,7 @@ -import "./index"; +import "."; describe("String.prototype.swapCase", () => { - test("\"Hello\".swapCase() returns \"hELLO\"", () => { - expect("Hello".swapCase()) - .toBe("hELLO"); + test('"Hello".swapCase() returns "hELLO"', () => { + expect("Hello".swapCase()).toBe("hELLO"); }); }); diff --git a/src/string/truncate/index.ts b/src/string/truncate/index.ts index c6629d57..007037d5 100644 --- a/src/string/truncate/index.ts +++ b/src/string/truncate/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/truncate/method.ts b/src/string/truncate/method.ts index 4367d67e..67cecdf5 100644 --- a/src/string/truncate/method.ts +++ b/src/string/truncate/method.ts @@ -1,7 +1,9 @@ const method = (str: string, num: number, truncateString = "..."): string => { const length = truncateString.length; - return str.length > num ? str.slice(0, num > length ? num - length : num) + truncateString : str; + return str.length > num + ? str.slice(0, num > length ? num - length : num) + truncateString + : str; }; export = method; diff --git a/src/string/truncate/test.ts b/src/string/truncate/test.ts index 47df515e..2cf76349 100644 --- a/src/string/truncate/test.ts +++ b/src/string/truncate/test.ts @@ -1,23 +1,19 @@ -import "./index"; +import "."; describe("String.prototype.truncate", () => { - test("\"boomerang\".truncate(7) returns \"boom...\"", () => { - expect("boomerang".truncate(7)) - .toBe("boom..."); + test('"boomerang".truncate(7) returns "boom..."', () => { + expect("boomerang".truncate(7)).toBe("boom..."); }); - test("\"boomerang\".truncate(7, \"....\") returns \"boo....\"", () => { - expect("boomerang".truncate(7, "....")) - .toBe("boo...."); + test('"boomerang".truncate(7, "....") returns "boo...."', () => { + expect("boomerang".truncate(7, "....")).toBe("boo...."); }); - test("\"boomerang\".truncate(10) returns \"boomerang\"", () => { - expect("boomerang".truncate(10)) - .toBe("boomerang"); + test('"boomerang".truncate(10) returns "boomerang"', () => { + expect("boomerang".truncate(10)).toBe("boomerang"); }); - test("\"boomerang\".truncate(2) returns \"bo...\"", () => { - expect("boomerang".truncate(2)) - .toBe("bo..."); + test('"boomerang".truncate(2) returns "bo..."', () => { + expect("boomerang".truncate(2)).toBe("bo..."); }); }); diff --git a/src/string/words/index.ts b/src/string/words/index.ts index 516f9c21..e62787e7 100644 --- a/src/string/words/index.ts +++ b/src/string/words/index.ts @@ -1,5 +1,5 @@ -import * as method from "./method"; import { addPrototype } from "../../utils"; +import method from "./method"; declare global { interface String { diff --git a/src/string/words/method.ts b/src/string/words/method.ts index d753c6f8..6b30cb63 100644 --- a/src/string/words/method.ts +++ b/src/string/words/method.ts @@ -1,3 +1,4 @@ -const method = (str: string, pattern = /[^a-zA-Z-]+/): string[] => str.split(pattern).filter(Boolean); +const method = (str: string, pattern = /[^a-zA-Z-]+/): string[] => + str.split(pattern).filter(Boolean); export = method; diff --git a/src/string/words/test.ts b/src/string/words/test.ts index 4cd5f9fb..11c3c92a 100644 --- a/src/string/words/test.ts +++ b/src/string/words/test.ts @@ -1,13 +1,15 @@ -import "./index"; +import "."; describe("String.prototype.words", () => { - test("\"I love javaScript!!\".words() returns [\"I\", \"love\", \"javaScript\"]", () => { - expect("I love javaScript!!".words()) - .toEqual(["I", "love", "javaScript"]); + test('"I love javaScript!!".words() returns ["I", "love", "javaScript"]', () => { + expect("I love javaScript!!".words()).toEqual(["I", "love", "javaScript"]); }); - test("\"python, javaScript & coffee\".words() returns [\"python\", \"javaScript\" ,\"coffee\"]", () => { - expect("python, javaScript & coffee".words()) - .toEqual(["python", "javaScript", "coffee"]); + test('"python, javaScript & coffee".words() returns ["python", "javaScript" ,"coffee"]', () => { + expect("python, javaScript & coffee".words()).toEqual([ + "python", + "javaScript", + "coffee", + ]); }); }); diff --git a/src/types.ts b/src/types.ts deleted file mode 100644 index a5bc757e..00000000 --- a/src/types.ts +++ /dev/null @@ -1 +0,0 @@ -export type Operator = "<" | "<=" | "=" | "<>" | ">=" | ">"; diff --git a/src/utils.test.ts b/src/utils.test.ts index 663417b6..56f338e1 100644 --- a/src/utils.test.ts +++ b/src/utils.test.ts @@ -2,8 +2,13 @@ import * as utils from "./utils"; describe("utils", () => { test("pathToKeys", () => { - expect(utils.pathToKeys("selector.to[0][11].value")) - .toEqual(["selector", "to", 0, 11, "value"]); + expect(utils.pathToKeys("selector.to[0][11].value")).toEqual([ + "selector", + "to", + 0, + 11, + "value", + ]); }); test("addPrototype to Object", () => { @@ -35,7 +40,8 @@ describe("utils", () => { }); test("deepClone Function", () => { - function a() { } + // tslint:disable-next-line: no-empty function-name + function a() {} expect(utils.deepClone(a)).toBe(a); }); diff --git a/src/utils.ts b/src/utils.ts index b14bd869..b2ee8ee4 100644 --- a/src/utils.ts +++ b/src/utils.ts @@ -6,16 +6,17 @@ * @example * pathToKeys("selector.to[0][11].value"); // ["selector", "to", 0, 11, "value"] */ -export const pathToKeys = (path: string) => path - .replace(/([^\.])\[/g, (m, match) => `${match}.[`) - .split(".") - .map((key) => { - const match = key.match(/^\[(\d+)\]$/); +export const pathToKeys = (path: string) => + path + .replace(/([^\.])\[/g, (m, match) => `${match}.[`) + .split(".") + .map(key => { + const match = key.match(/^\[(\d+)\]$/); - if (match) return +match[1]; + if (match) return +match[1]; - return key; - }); + return key; + }); /** * @@ -26,21 +27,21 @@ export const pathToKeys = (path: string) => path * @example * addPrototype(Object, "$size", function() {return this;}); */ -export const addPrototype = (obj: any, key: string, method: (...args: any[]) => any) => { +export const addPrototype = ( + obj: any, + key: string, + method: (...args: any[]) => any, +) => { const prototype = obj.prototype; if (prototype.hasOwnProperty(key)) return; - Object.defineProperty( - prototype, - key, - { - value(...args: any[]) { - return method.apply(0, [this].concat(args)); - }, - writable: true, - } - ); + Object.defineProperty(prototype, key, { + value(...args: any[]) { + return method.apply(0, [this].concat(args)); + }, + writable: true, + }); }; /** @@ -54,12 +55,15 @@ export const addPrototype = (obj: any, key: string, method: (...args: any[]) => * filter([1, 2, 3], undefined, (value) => value > 1); */ export const filter = ( - arr: T[], path: string | undefined, fn: (value: T, index: number, array: T[]) => any + arr: T[], + path: string | undefined, + fn: (value: T, index: number, array: T[]) => any, ) => { if (path) { const keys = pathToKeys(path); - const reducer = (item: T) => keys.reduce((prev, curr) => (prev as any)[curr], item); + const reducer = (item: T) => + keys.reduce((prev, curr) => (prev as any)[curr], item); return arr.filter((item, index, items) => fn(reducer(item), index, items)); } @@ -82,11 +86,13 @@ export const deepClone = (value: T): T => { const clone: any = Object.assign({}, value); - Object.keys(clone) - .forEach((key) => (clone[key] = typeof (value as any)[key] === "object" ? - deepClone((value as any)[key]) : - (value as any)[key]) - ); + Object.keys(clone).forEach( + key => + (clone[key] = + typeof (value as any)[key] === "object" + ? deepClone((value as any)[key]) + : (value as any)[key]), + ); if (Array.isArray(value)) { clone.length = value.length; @@ -96,3 +102,14 @@ export const deepClone = (value: T): T => { return clone; }; + +export type Operator = "<" | "<=" | "=" | "<>" | ">=" | ">"; + +export const enum OPERATOR { + LT = "<", + LTE = "<=", + EQ = "=", + NE = "<>", + GTE = ">=", + GT = ">", +} diff --git a/tsconfig.json b/tsconfig.json index 4906cac6..35fba942 100644 --- a/tsconfig.json +++ b/tsconfig.json @@ -1,18 +1,65 @@ { - "compileOnSave": true, "compilerOptions": { - "module": "commonjs", - "target": "es6", - "rootDir": "src", - "outDir": "es6", - "declaration": true, - "strict": true + /* Basic Options */ + // "incremental": true, /* Enable incremental compilation */ + "target": "es6" /* Specify ECMAScript target version: 'ES3' (default), 'ES5', 'ES2015', 'ES2016', 'ES2017', 'ES2018', 'ES2019' or 'ESNEXT'. */, + "module": "commonjs" /* Specify module code generation: 'none', 'commonjs', 'amd', 'system', 'umd', 'es2015', or 'ESNext'. */, + // "lib": [], /* Specify library files to be included in the compilation. */ + // "allowJs": true, /* Allow javascript files to be compiled. */ + // "checkJs": true, /* Report errors in .js files. */ + // "jsx": "preserve", /* Specify JSX code generation: 'preserve', 'react-native', or 'react'. */ + "declaration": true /* Generates corresponding '.d.ts' file. */, + // "declarationMap": true, /* Generates a sourcemap for each corresponding '.d.ts' file. */ + // "sourceMap": true, /* Generates corresponding '.map' file. */ + // "outFile": "./", /* Concatenate and emit output to single file. */ + "outDir": "es6" /* Redirect output structure to the directory. */, + "rootDir": "src" /* Specify the root directory of input files. Use to control the output directory structure with --outDir. */, + // "composite": true, /* Enable project compilation */ + // "tsBuildInfoFile": "./", /* Specify file to store incremental compilation information */ + // "removeComments": true, /* Do not emit comments to output. */ + // "noEmit": true, /* Do not emit outputs. */ + // "importHelpers": true, /* Import emit helpers from 'tslib'. */ + // "downlevelIteration": true, /* Provide full support for iterables in 'for-of', spread, and destructuring when targeting 'ES5' or 'ES3'. */ + // "isolatedModules": true, /* Transpile each file as a separate module (similar to 'ts.transpileModule'). */ + + /* Strict Type-Checking Options */ + "strict": true /* Enable all strict type-checking options. */, + // "noImplicitAny": true, /* Raise error on expressions and declarations with an implied 'any' type. */ + // "strictNullChecks": true, /* Enable strict null checks. */ + // "strictFunctionTypes": true, /* Enable strict checking of function types. */ + // "strictBindCallApply": true, /* Enable strict 'bind', 'call', and 'apply' methods on functions. */ + // "strictPropertyInitialization": true, /* Enable strict checking of property initialization in classes. */ + // "noImplicitThis": true, /* Raise error on 'this' expressions with an implied 'any' type. */ + // "alwaysStrict": true, /* Parse in strict mode and emit "use strict" for each source file. */ + + /* Additional Checks */ + // "noUnusedLocals": true, /* Report errors on unused locals. */ + // "noUnusedParameters": true, /* Report errors on unused parameters. */ + // "noImplicitReturns": true, /* Report error when not all code paths in function return a value. */ + // "noFallthroughCasesInSwitch": true, /* Report errors for fallthrough cases in switch statement. */ + + /* Module Resolution Options */ + // "moduleResolution": "node", /* Specify module resolution strategy: 'node' (Node.js) or 'classic' (TypeScript pre-1.6). */ + // "baseUrl": "./", /* Base directory to resolve non-absolute module names. */ + // "paths": {}, /* A series of entries which re-map imports to lookup locations relative to the 'baseUrl'. */ + // "rootDirs": [], /* List of root folders whose combined content represents the structure of the project at runtime. */ + // "typeRoots": [], /* List of folders to include type definitions from. */ + // "types": [], /* Type declaration files to be included in compilation. */ + // "allowSyntheticDefaultImports": true, /* Allow default imports from modules with no default export. This does not affect code emit, just typechecking. */ + "esModuleInterop": true /* Enables emit interoperability between CommonJS and ES Modules via creation of namespace objects for all imports. Implies 'allowSyntheticDefaultImports'. */ + // "preserveSymlinks": true, /* Do not resolve the real path of symlinks. */ + // "allowUmdGlobalAccess": true, /* Allow accessing UMD globals from modules. */ + + /* Source Map Options */ + // "sourceRoot": "", /* Specify the location where debugger should locate TypeScript files instead of source locations. */ + // "mapRoot": "", /* Specify the location where debugger should locate map files instead of generated locations. */ + // "inlineSourceMap": true, /* Emit a single file with source maps instead of having a separate file. */ + // "inlineSources": true, /* Emit the source alongside the sourcemaps within a single file; requires '--inlineSourceMap' or '--sourceMap' to be set. */ + + /* Experimental Options */ + // "experimentalDecorators": true, /* Enables experimental support for ES7 decorators. */ + // "emitDecoratorMetadata": true, /* Enables experimental support for emitting type metadata for decorators. */ }, - "include": [ - "src/**/*" - ], - "exclude": [ - "**/test.ts", - "**/*.test.ts" - ] + "include": ["src"], + "exclude": ["**/test.ts", "**/*.test.ts"] } diff --git a/tslint.bkp.json b/tslint.bkp.json new file mode 100644 index 00000000..c7464645 --- /dev/null +++ b/tslint.bkp.json @@ -0,0 +1,87 @@ +{ + "defaultSeverity": "error", + "extends": [ + "tslint:recommended" + ], + "jsRules": {}, + "rules": { + "trailing-comma": [ + true, + { + "multiline": { + "objects": "always", + "arrays": "always", + "functions": "never", + "typeLiterals": "ignore" + }, + "esSpecCompliant": true + } + ], + "ordered-imports": false, + "no-namespace": false, + "no-internal-module": false, + "interface-name": [ + true, + "never-prefix" + ], + "no-empty-interface": false, + "member-access": [ + true, + "no-public" + ], + "object-literal-sort-keys": false, + "variable-name": [ + true, + "ban-keywords", + "check-format", + "allow-pascal-case", + "allow-leading-underscore" + ], + "no-angle-bracket-type-assertion": false, + "no-shadowed-variable": false, + "member-ordering": [ + true, + { + "order": [ + "private-static-field", + "public-static-field", + "private-instance-field", + "public-instance-field", + "private-constructor", + "public-constructor", + "protected-instance-method", + "private-instance-method", + "public-instance-method" + ] + } + ], + "no-console": false, + "no-empty": false, + "whitespace": [ + true, + "check-branch", + "check-decl", + "check-operator", + "check-module", + "check-separator", + "check-rest-spread", + "check-type", + "check-type-operator", + "check-preblock" + ], + "forin": false, + "curly": [ + true, + "as-needed" + ], + "unified-signatures": false, + "prefer-for-of": false, + "no-bitwise": false, + "space-before-function-paren": ["error", { + "anonymous": "never", + "named": "always", + "asyncArrow": "always" + }] + }, + "rulesDirectory": ["src"] +} \ No newline at end of file diff --git a/tslint.json b/tslint.json index e6851f43..725f1f2a 100644 --- a/tslint.json +++ b/tslint.json @@ -1,87 +1,16 @@ { "defaultSeverity": "error", - "extends": [ - "tslint:recommended" - ], - "jsRules": {}, + "extends": ["tslint:recommended", "tslint-config-airbnb"], "rules": { - "trailing-comma": [ - true, - { - "multiline": { - "objects": "always", - "arrays": "always", - "functions": "never", - "typeLiterals": "ignore" - }, - "esSpecCompliant": true - } - ], - "ordered-imports": false, - "no-namespace": false, - "no-internal-module": false, - "interface-name": [ - true, - "never-prefix" - ], - "no-empty-interface": false, - "member-access": [ - true, - "no-public" - ], - "object-literal-sort-keys": false, - "variable-name": [ - true, - "ban-keywords", - "check-format", - "allow-pascal-case", - "allow-leading-underscore" - ], - "no-angle-bracket-type-assertion": false, - "no-shadowed-variable": false, - "member-ordering": [ - true, - { - "order": [ - "private-static-field", - "public-static-field", - "private-instance-field", - "public-instance-field", - "private-constructor", - "public-constructor", - "protected-instance-method", - "private-instance-method", - "public-instance-method" - ] - } - ], - "no-console": false, - "no-empty": false, - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-module", - "check-separator", - "check-rest-spread", - "check-type", - "check-type-operator", - "check-preblock" - ], - "forin": false, - "curly": [ - true, - "as-needed" - ], - "unified-signatures": false, + "import-name": false, + "interface-name": false, + "no-parameter-reassignment": false, + "no-increment-decrement": false, "prefer-for-of": false, - "no-bitwise": false, - "space-before-function-paren": ["error", { - "anonymous": "never", - "named": "always", - "asyncArrow": "always" - }] + "object-literal-sort-keys": false, + "ter-arrow-parens": false, + "quotemark": [true, "double", "avoid-escape"], + "prefer-array-literal": [true, { "allow-type-parameters": true }] }, - "rulesDirectory": [] -} \ No newline at end of file + "rulesDirectory": ["src"] +} From b72ca722f4bfbcc37454aed719b6d6adf8bc8aeb Mon Sep 17 00:00:00 2001 From: Ardalan Amini Date: Thu, 6 Jun 2019 01:03:34 +0430 Subject: [PATCH 3/3] Updated version --- CHANGELOG.md | 64 +++++++++++++---------- README.md | 26 +++++---- package-lock.json | 2 +- package.json | 2 +- src/function/isFunction/method.ts | 2 +- src/function/isFunction/test.ts | 4 ++ tslint.bkp.json | 87 ------------------------------- 7 files changed, 55 insertions(+), 132 deletions(-) delete mode 100644 tslint.bkp.json diff --git a/CHANGELOG.md b/CHANGELOG.md index b8cc56c5..844e4029 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -12,13 +12,21 @@ --- -## [1.0.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v1.0.0) - *(2019-03-11)* +## [1.0.1](https://github.com/ardalanamini/prototyped.js/releases/tag/v1.0.1) - _(2019-06-06)_ + +- `Function` + - :beetle: `isFunction` bug fixed +- :star2: Improved Typescript usage +- :star2: Improved linting +- :eyeglasses: Included Node.js `v11` and `v12` for `travis-ci` tests + +## [1.0.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v1.0.0) - _(2019-03-11)_ - `Object` - `prototype` - :zap: `flatten` Added -## [v0.21.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.21.0) - *(2018-12-01)* +## [v0.21.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.21.0) - _(2018-12-01)_ - `Array` - `prototype` @@ -29,13 +37,13 @@ - `prototype` - :zap: `dig` Added -## [v0.20.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.20.0) - *(2018-09-30)* +## [v0.20.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.20.0) - _(2018-09-30)_ - `Array` - `prototype` - :zap: `unwind` Added -## [v0.19.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.19.0) - *(2018-08-22)* +## [v0.19.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.19.0) - _(2018-08-22)_ - `Array` - `prototype` @@ -45,7 +53,7 @@ - :boom: Renamed `dist` path to `es5` - :boom: Set `es6` as default -## [v0.18.1](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.18.1) - *(2018-08-18)* +## [v0.18.1](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.18.1) - _(2018-08-18)_ - `Array` - `prototype` @@ -54,7 +62,7 @@ - `prototype` - :beetle: Deep `cloning` empty array bug fix -## [v0.18.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.18.0) - *(2018-08-18)* +## [v0.18.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.18.0) - _(2018-08-18)_ - `Object` - `prototype` @@ -64,7 +72,7 @@ - :boom: `singularize` Removed (use `pluralize(1)` instead) - :star2: Removed `pluralize` dependency (no more dependency :sunglasses:) -## [v0.17.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.17.0) - *(2018-08-17)* +## [v0.17.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.17.0) - _(2018-08-17)_ - `Array` - `prototype` @@ -80,7 +88,7 @@ - :zap: `reduce` Added - :star2: Some general enhancements -## [v0.16.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.16.0) - *(2018-08-15)* +## [v0.16.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.16.0) - _(2018-08-15)_ - `Array` - `prototype` @@ -93,7 +101,7 @@ - `prototype` - :beetle: `$clone` Fixed deep cloning bug -## [v0.14.1](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.14.1) - *(2018-08-11)* +## [v0.14.1](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.14.1) - _(2018-08-11)_ - `String` - `prototype` @@ -101,7 +109,7 @@ - :beetle: `kebabCase` Fixed regex bug - :beetle: `snakeCase` Fixed regex bug -## [v0.14.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.14.0) - *(2018-08-10)* +## [v0.14.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.14.0) - _(2018-08-10)_ - `Date` - :zap: `today` Added @@ -125,7 +133,7 @@ - :zap: `forEach` Added - :mortar_board: Improved documents -## [v0.13.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.13.0) - *(2018-08-01)* +## [v0.13.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.13.0) - _(2018-08-01)_ - `String` - `prototype` @@ -141,13 +149,13 @@ - `Number` - :beetle: `isNumber` Fixed considering numeral strings as number -## [v0.12.1](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.12.1) - *(2018-07-31)* +## [v0.12.1](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.12.1) - _(2018-07-31)_ - `Array` - `prototype` - :beetle: `nest` Fixed finding children of children bug -## [v0.12.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.12.0) - *(2018-07-26)* +## [v0.12.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.12.0) - _(2018-07-26)_ - `Object` - `prototype` @@ -155,7 +163,7 @@ - :zap: `$defaults` Added - :zap: `$keys` Added -## [v0.11.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.11.0) - *(2018-07-16)* +## [v0.11.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.11.0) - _(2018-07-16)_ - `Array` - `prototype` @@ -174,7 +182,7 @@ - :zap: `equals` Added - :zap: `parseInt` Added -## [v0.10.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.10.0) - *(2018-06-01)* +## [v0.10.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.10.0) - _(2018-06-01)_ - `Array` - :boom: `isInstance` Removed @@ -196,7 +204,7 @@ - :boom: `isInstance` Renamed to `isString` - :star2: Better object value path handling -## [v0.9.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.9.0) - *(2018-05-29)* +## [v0.9.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.9.0) - _(2018-05-29)_ - `Array` - `prototype` @@ -212,7 +220,7 @@ - :zap: `pad` Added - :zap: `repeat` Added -## [v0.8.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.8.0) - *(2018-05-25)* +## [v0.8.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.8.0) - _(2018-05-25)_ - `Array` - `prototype` @@ -225,7 +233,7 @@ - :zap: `$get` Added - :zap: `$omit` Added -## [v0.7.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.7.0) - *(2018-05-20)* +## [v0.7.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.7.0) - _(2018-05-20)_ - `Object` - `prototype` @@ -233,7 +241,7 @@ - :zap: `$kebabCaseKeys` Added - :zap: `$snakeCaseKeys` Added -## [v0.6.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.6.0) - *(2018-05-11)* +## [v0.6.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.6.0) - _(2018-05-11)_ - `Array` - `prototype` @@ -252,7 +260,7 @@ - :zap: `whereNotNull` Added - :zap: `whereNull` Added -## [v0.5.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.5.0) - *(2018-04-13)* +## [v0.5.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.5.0) - _(2018-04-13)_ - `Array` - `prototype` @@ -274,7 +282,7 @@ - :star2: Some general enhancements - :beetle: Typescript usage -## [v0.4.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.4.0) - *(2018-01-28)* +## [v0.4.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.4.0) - _(2018-01-28)_ - `String` - `prototype` @@ -284,7 +292,7 @@ - :zap: `humanize` Added - :star2: More customizable usage -## [v0.3.2](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.3.2) - *(2018-01-25)* +## [v0.3.2](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.3.2) - _(2018-01-25)_ - `Array` - `prototype` @@ -295,12 +303,12 @@ - `prototype` - :zap: `contains` Added -## [v0.3.1](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.3.1) - *(2018-01-24)* +## [v0.3.1](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.3.1) - _(2018-01-24)_ - :star2: `es6` Usage is now available along side `es5` (`dist`) - :beetle: Typescript usage -## [v0.3.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.3.0) - *(2018-01-24)* +## [v0.3.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.3.0) - _(2018-01-24)_ - `Array` - :zap: `isInstance` Added @@ -334,7 +342,7 @@ - :zap: `isEven` Added - :zap: `isPrime` Added -## [v0.2.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.2.0) - *(2018-01-18)* +## [v0.2.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.2.0) - _(2018-01-18)_ - `Array` - `prototype` @@ -357,14 +365,14 @@ - :beetle: `decapitalize` Fixed returning the capitalized string - :eyeglasses: Added tests -## [v0.1.2](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.1.2) - *(2018-01-15)* +## [v0.1.2](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.1.2) - _(2018-01-15)_ - :mortar_board: Fix project name in README.md -## [v0.1.1](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.1.1) - *(2018-01-15)* +## [v0.1.1](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.1.1) - _(2018-01-15)_ - :mortar_board: Update README.md usage -## [v0.1.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.1.0) - *(2018-01-15)* +## [v0.1.0](https://github.com/ardalanamini/prototyped.js/releases/tag/v0.1.0) - _(2018-01-15)_ - :tada: First release diff --git a/README.md b/README.md index b024f408..1bfb65bc 100644 --- a/README.md +++ b/README.md @@ -46,36 +46,34 @@ import all prototypes ```javascript // es6 (default) -require('prototyped.js'); -import 'prototyped.js'; +import "prototyped.js"; -// es5 -require('prototyped.js/es5'); -import 'prototyped.js/es5'; +// or es5 +require("prototyped.js/es5"); -console.log('hello world!'.words()); // ['hello', 'world'] +console.log("hello world!".words()); // ['hello', 'world'] ``` or simply import the prototypes you want ```javascript -require('prototyped.js/es6/string'); +require("prototyped.js/es6/string"); // or -require('prototyped.js/es5/string/words'); +require("prototyped.js/es5/string/words"); -console.log('hello world!'.words()); // ['hello', 'world'] +console.log("hello world!".words()); // ['hello', 'world'] ``` even better, just import the method you want ```javascript -const words = require('prototyped.js/es6/string/words/method'); +const words = require("prototyped.js/es6/string/words/method"); -console.log(words('hello world!')); // ['hello', 'world'] +console.log(words("hello world!")); // ['hello', 'world'] -const methods = require('prototyped.js/es5/methods'); +const methods = require("prototyped.js/es5/methods"); -console.log(methods.string.words('hello world!')); // ['hello', 'world'] +console.log(methods.string.words("hello world!")); // ['hello', 'world'] ``` **All documents are available at [here](https://prototyped.js.org)** @@ -86,7 +84,7 @@ We use [SemVer](http://semver.org) for versioning. For the versions available, s ## Authors -- **Ardalan Amini** - *Owner/Developer* - [@ardalanamini](https://github.com/ardalanamini) +- **Ardalan Amini** - _Core Maintainer_ - [@ardalanamini](https://github.com/ardalanamini) See also the list of [contributors](https://github.com/ardalanamini/prototyped.js/contributors) who participated in this project. diff --git a/package-lock.json b/package-lock.json index 4eb28893..ff037b91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "prototyped.js", - "version": "1.0.0", + "version": "1.0.1", "lockfileVersion": 1, "requires": true, "dependencies": { diff --git a/package.json b/package.json index 0833b818..f77448a7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "prototyped.js", - "version": "1.0.0", + "version": "1.0.1", "description": "Common typescript ready prototypes available in both es5 and es6", "author": { "name": "Ardalan Amini", diff --git a/src/function/isFunction/method.ts b/src/function/isFunction/method.ts index 637a9ada..31ea504a 100644 --- a/src/function/isFunction/method.ts +++ b/src/function/isFunction/method.ts @@ -1,4 +1,4 @@ // tslint:disable-next-line:ban-types -const method = (arg: any): arg is Function => arg instanceof Function; +const method = (arg: any): arg is Function => typeof arg === "function"; export = method; diff --git a/src/function/isFunction/test.ts b/src/function/isFunction/test.ts index 50079256..901e58eb 100644 --- a/src/function/isFunction/test.ts +++ b/src/function/isFunction/test.ts @@ -8,4 +8,8 @@ describe("Function.isFunction", () => { test("Function.isFunction((() => {})) returns true", () => { expect(Function.isFunction(() => {})).toBe(true); }); + + test("Function.isFunction(jest.fn()) returns true", () => { + expect(Function.isFunction(jest.fn())).toBe(true); + }); }); diff --git a/tslint.bkp.json b/tslint.bkp.json deleted file mode 100644 index c7464645..00000000 --- a/tslint.bkp.json +++ /dev/null @@ -1,87 +0,0 @@ -{ - "defaultSeverity": "error", - "extends": [ - "tslint:recommended" - ], - "jsRules": {}, - "rules": { - "trailing-comma": [ - true, - { - "multiline": { - "objects": "always", - "arrays": "always", - "functions": "never", - "typeLiterals": "ignore" - }, - "esSpecCompliant": true - } - ], - "ordered-imports": false, - "no-namespace": false, - "no-internal-module": false, - "interface-name": [ - true, - "never-prefix" - ], - "no-empty-interface": false, - "member-access": [ - true, - "no-public" - ], - "object-literal-sort-keys": false, - "variable-name": [ - true, - "ban-keywords", - "check-format", - "allow-pascal-case", - "allow-leading-underscore" - ], - "no-angle-bracket-type-assertion": false, - "no-shadowed-variable": false, - "member-ordering": [ - true, - { - "order": [ - "private-static-field", - "public-static-field", - "private-instance-field", - "public-instance-field", - "private-constructor", - "public-constructor", - "protected-instance-method", - "private-instance-method", - "public-instance-method" - ] - } - ], - "no-console": false, - "no-empty": false, - "whitespace": [ - true, - "check-branch", - "check-decl", - "check-operator", - "check-module", - "check-separator", - "check-rest-spread", - "check-type", - "check-type-operator", - "check-preblock" - ], - "forin": false, - "curly": [ - true, - "as-needed" - ], - "unified-signatures": false, - "prefer-for-of": false, - "no-bitwise": false, - "space-before-function-paren": ["error", { - "anonymous": "never", - "named": "always", - "asyncArrow": "always" - }] - }, - "rulesDirectory": ["src"] -} \ No newline at end of file