diff --git a/CHANGELOG.md b/CHANGELOG.md index d6b9c40..7dae991 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,11 @@ All notable changes to this project will be documented in this file. The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/) and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html). +## [1.4.0] - 2019-09-08 + +### Added +- Enable variable expansion in component helper paths + ## [1.3.0] - 2019-09-08 ### Added diff --git a/docs/pages/api/component.md b/docs/pages/api/component.md index a66ac52..7740c5a 100644 --- a/docs/pages/api/component.md +++ b/docs/pages/api/component.md @@ -156,7 +156,7 @@ You can use: - [array syntax](#array-syntax) - to map properties 1:1 with the store - [object syntax](#object-syntax) - to map properties with different names on the component -- [wildcard syntax](#wildcard-syntax) - to grab sets of properties automatically +- [wildcard expansion](#wildcard-expansion) - to grab sets of properties automatically Each syntax generates an **Object** of **named properties** which must be mixed in to the associated block (`computed` or `methods`) or set as the block itself: @@ -405,4 +405,4 @@ export default { } ``` -If you're interested to see what happens behind the scenes [check out the code](https://github.com/davestewart/vuex-pathify/blob/develop/src/helpers/modules.js) on GitHub. \ No newline at end of file +If you're interested to see what happens behind the scenes [check out the code](https://github.com/davestewart/vuex-pathify/blob/develop/src/helpers/modules.js) on GitHub. diff --git a/docs/pages/api/paths.md b/docs/pages/api/paths.md index 2a93f28..eb9c17f 100644 --- a/docs/pages/api/paths.md +++ b/docs/pages/api/paths.md @@ -7,6 +7,7 @@ Pathify provides a rich [path syntax](#core-syntax) to access Vuex stores, including: - module, property and sub-property access +- variable expansion - wildcard expansion There are some additional [direct syntaxes](#direct-syntax) as well, which are designed to handle customisation around non `get/set` naming: @@ -86,7 +87,29 @@ set('filters@search', 'blue') See the [sub-property access](/api/properties.md#sub-property-access) section for more information. -### Wildcard syntax +### Variable expansion + +Variable `:notation` allows you to use component properties to dynamically build references to store properties. + +They may only be used in [component helpers](/api/component.md) but can reference store properties or sub-properties: + +```js +// dynamically reference a property or sub-property +get('projects/:slug') +get('projects@:slug') + +// dynamically sync a deeply-nested property using object and array notation using multiple variables +sync('clients/:name@project[:index].name') +``` + +Note the following caveats: + +- only top-level properties may be used as variable names, i.e. `:index` but not `:options.index` +- when getting, only `state` will be referenced; `getters` will be ignored +- when setting, only `mutations` will be referenced; `actions` will be ignored +- you can use array `[:index]` or dot `.index` notation for arrays + +### Wildcard expansion Wildcards `*` allow you to reference multiple properties at once, and are used only in components: diff --git a/docs/pages/home.md b/docs/pages/home.md index 5411eb0..3799e28 100644 --- a/docs/pages/home.md +++ b/docs/pages/home.md @@ -55,6 +55,13 @@ Wire **multiple** properties (or sub-properties) using **array**, **object** and ``` +Use **variable expansion** to dynamically reference store properties: + +```pathify +get('products/:index'), +``` + + Set up your store – **no matter how complex** – in a single line: ```pathify @@ -85,4 +92,4 @@ To see Pathify in action: For a deeper insight: - read the [Intro](/intro/pathify.md) for an overview of the Pathify mechanism -- check out the [code comparison](https://codesandbox.io/s/github/davestewart/vuex-pathify-demos/tree/master/main?initialpath=code) demos which illustrate reductions in Vuex code of between **2 and 14 times** \ No newline at end of file +- check out the [code comparison](https://codesandbox.io/s/github/davestewart/vuex-pathify-demos/tree/master/main?initialpath=code) demos which illustrate reductions in Vuex code of between **2 and 14 times** diff --git a/package-lock.json b/package-lock.json index 89b6b7b..8c70204 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "vuex-pathify", - "version": "1.2.4", + "version": "1.3.0", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -29,22 +29,16 @@ "dev": true }, "acorn-dynamic-import": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-3.0.0.tgz", - "integrity": "sha512-zVWV8Z8lislJoOKKqdNMOB+s6+XV5WERty8MnKBeFgwA+19XJjJHs2RP5dzM57FftIs+jQnRToLiWazKr6sSWg==", - "dev": true, - "requires": { - "acorn": "^5.0.0" - } + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/acorn-dynamic-import/-/acorn-dynamic-import-4.0.0.tgz", + "integrity": "sha512-d3OEjQV4ROpoflsnUA8HozoIR504TFxNivYEUi6uwz0IYhBkTDXGuWlNdMtybRt3nqVx/L6XqMt0FxkXuWKZhw==", + "dev": true }, "acorn-jsx": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-4.1.1.tgz", - "integrity": "sha512-JY+iV6r+cO21KtntVvFkD+iqjtdpRUpGqKWgfkCdZq1R+kbreEl8EcdcJR4SmiIgsIQT33s6QzheQ9a275Q8xw==", - "dev": true, - "requires": { - "acorn": "^5.0.3" - } + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.2.tgz", + "integrity": "sha512-tiNTrP1MP0QrChmD2DdupCr6HWSFeKVw5d/dHTu4Y7rkAkRhU/Dt7dphAfIUyxtHpl/eBVip5uTNSpQJHylpAw==", + "dev": true }, "ajv": { "version": "6.10.0", @@ -71,9 +65,9 @@ "dev": true }, "ansi-styles": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.0.tgz", - "integrity": "sha512-NnSOmMEYtVR2JVMIGTzynRkkaxtiq1xnFBcdQD/DnNCYPoEPsVJhM98BDyaoNOQIi7p4okdi3E27eN7GQbsUug==", + "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" @@ -175,19 +169,42 @@ } }, "buble": { - "version": "0.19.3", - "resolved": "https://registry.npmjs.org/buble/-/buble-0.19.3.tgz", - "integrity": "sha512-3B0Lcy2u6x6km0BqTz/FS3UnrOJlnIlBWsyjvtqzdtmWkqiS0+Sg4hc6L9Mmm63hZKTACpYS9vUeIoKSi1vcrQ==", + "version": "0.19.8", + "resolved": "https://registry.npmjs.org/buble/-/buble-0.19.8.tgz", + "integrity": "sha512-IoGZzrUTY5fKXVkgGHw3QeXFMUNBFv+9l8a4QJKG1JhG3nCMHTdEX1DCOg8568E2Q9qvAQIiSokv6Jsgx8p2cA==", "dev": true, "requires": { - "acorn": "^5.4.1", - "acorn-dynamic-import": "^3.0.0", - "acorn-jsx": "^4.1.1", - "chalk": "^2.3.1", - "magic-string": "^0.22.4", + "acorn": "^6.1.1", + "acorn-dynamic-import": "^4.0.0", + "acorn-jsx": "^5.0.1", + "chalk": "^2.4.2", + "magic-string": "^0.25.3", "minimist": "^1.2.0", - "os-homedir": "^1.0.1", - "vlq": "^1.0.0" + "os-homedir": "^2.0.0", + "regexpu-core": "^4.5.4" + }, + "dependencies": { + "acorn": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.3.0.tgz", + "integrity": "sha512-/czfa8BwS88b9gWQVhc8eknunSA2DoJpJyTQkhheIf5E48u1N0R4q/YxxsAeqRrmK9TQ/uYfgLDfZo91UlANIA==", + "dev": true + }, + "magic-string": { + "version": "0.25.3", + "resolved": "https://registry.npmjs.org/magic-string/-/magic-string-0.25.3.tgz", + "integrity": "sha512-6QK0OpF/phMz0Q2AxILkX2mFhi7m+WMwTRg0LQKq/WBB0cDP4rYH3Wp4/d3OTXlrPLVJT/RFqj8tFeAR4nk8AA==", + "dev": true, + "requires": { + "sourcemap-codec": "^1.4.4" + } + }, + "os-homedir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/os-homedir/-/os-homedir-2.0.0.tgz", + "integrity": "sha512-saRNz0DSC5C/I++gFIaJTXoFJMRwiP5zHar5vV3xQ2TkgEw6hDCcU5F272JjUylpiVgBrZNQHnfjkLabTfb92Q==", + "dev": true + } } }, "camelcase": { @@ -213,14 +230,14 @@ "dev": true }, "chalk": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.3.1.tgz", - "integrity": "sha512-QUU4ofkDoMIVO7hcx1iPTISs88wsO8jA92RQIm4JAwZvFGGAV2hSAA1NX7oVj2Ej2Q6NDTcRDjPTFrMCRZoJ6g==", + "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.0", + "ansi-styles": "^3.2.1", "escape-string-regexp": "^1.0.5", - "supports-color": "^5.2.0" + "supports-color": "^5.3.0" } }, "cliui": { @@ -241,12 +258,12 @@ "dev": true }, "color-convert": { - "version": "1.9.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.1.tgz", - "integrity": "sha512-mjGanIiwQJskCC18rPR6OmrZ6fm2Lc7PeGFYwCmy5J34wC6F1PzdGL6xeMfmgicfYcNLGuVFA3WzXtIDCQSZxQ==", + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", "dev": true, "requires": { - "color-name": "^1.1.1" + "color-name": "1.1.3" } }, "color-name": { @@ -674,6 +691,12 @@ "integrity": "sha1-peZUwuWi3rXyAdls77yoDA7y9RM=", "dev": true }, + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + }, "json-schema": { "version": "0.2.3", "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.2.3.tgz", @@ -971,9 +994,9 @@ } }, "npm": { - "version": "6.9.0", - "resolved": "https://registry.npmjs.org/npm/-/npm-6.9.0.tgz", - "integrity": "sha512-91V+zB5hDxO+Jyp2sUKS7juHlIM95dGQxTeQtmZI1nAI/7kjWXFipPrtwwKjhyKmV4GsS2LzJhrxRjGWsU9z/w==", + "version": "6.11.3", + "resolved": "https://registry.npmjs.org/npm/-/npm-6.11.3.tgz", + "integrity": "sha512-K2h+MPzZiY39Xf6eHEdECe/LKoJXam4UCflz5kIxoskN3LQFeYs5fqBGT5i4TtM/aBk+86Mcf+jgXs/WuWAutQ==", "dev": true, "requires": { "JSONStream": "^1.3.5", @@ -982,16 +1005,16 @@ "ansistyles": "~0.1.3", "aproba": "^2.0.0", "archy": "~1.0.0", - "bin-links": "^1.1.2", - "bluebird": "^3.5.3", + "bin-links": "^1.1.3", + "bluebird": "^3.5.5", "byte-size": "^5.0.1", - "cacache": "^11.3.2", - "call-limit": "~1.1.0", - "chownr": "^1.1.1", + "cacache": "^12.0.3", + "call-limit": "^1.1.1", + "chownr": "^1.1.2", "ci-info": "^2.0.0", "cli-columns": "^3.1.2", "cli-table3": "^0.5.1", - "cmd-shim": "~2.0.2", + "cmd-shim": "^3.0.3", "columnify": "~1.5.4", "config-chain": "^1.1.12", "debuglog": "*", @@ -1003,27 +1026,28 @@ "find-npm-prefix": "^1.0.2", "fs-vacuum": "~1.2.10", "fs-write-stream-atomic": "~1.0.10", - "gentle-fs": "^2.0.1", - "glob": "^7.1.3", - "graceful-fs": "^4.1.15", + "gentle-fs": "^2.2.1", + "glob": "^7.1.4", + "graceful-fs": "^4.2.2", "has-unicode": "~2.0.1", - "hosted-git-info": "^2.7.1", + "hosted-git-info": "^2.8.2", "iferr": "^1.0.2", "imurmurhash": "*", + "infer-owner": "^1.0.4", "inflight": "~1.0.6", - "inherits": "~2.0.3", + "inherits": "^2.0.4", "ini": "^1.3.5", "init-package-json": "^1.10.3", "is-cidr": "^3.0.0", "json-parse-better-errors": "^1.0.2", "lazy-property": "~1.0.0", - "libcipm": "^3.0.3", - "libnpm": "^2.0.1", - "libnpmaccess": "*", - "libnpmhook": "^5.0.2", - "libnpmorg": "*", - "libnpmsearch": "*", - "libnpmteam": "*", + "libcipm": "^4.0.3", + "libnpm": "^3.0.1", + "libnpmaccess": "^3.0.2", + "libnpmhook": "^5.0.3", + "libnpmorg": "^1.0.1", + "libnpmsearch": "^2.0.2", + "libnpmteam": "^1.0.2", "libnpx": "^10.2.0", "lock-verify": "^2.1.0", "lockfile": "^1.0.4", @@ -1038,53 +1062,53 @@ "lodash.union": "~4.6.0", "lodash.uniq": "~4.5.0", "lodash.without": "~4.4.0", - "lru-cache": "^4.1.5", + "lru-cache": "^5.1.1", "meant": "~1.0.1", "mississippi": "^3.0.0", "mkdirp": "~0.5.1", "move-concurrently": "^1.0.1", - "node-gyp": "^3.8.0", + "node-gyp": "^5.0.3", "nopt": "~4.0.1", "normalize-package-data": "^2.5.0", "npm-audit-report": "^1.3.2", "npm-cache-filename": "~1.0.2", "npm-install-checks": "~3.0.0", - "npm-lifecycle": "^2.1.0", - "npm-package-arg": "^6.1.0", - "npm-packlist": "^1.4.1", - "npm-pick-manifest": "^2.2.3", - "npm-profile": "*", - "npm-registry-fetch": "^3.9.0", + "npm-lifecycle": "^3.1.3", + "npm-package-arg": "^6.1.1", + "npm-packlist": "^1.4.4", + "npm-pick-manifest": "^3.0.2", + "npm-profile": "^4.0.2", + "npm-registry-fetch": "^4.0.0", "npm-user-validate": "~1.0.0", "npmlog": "~4.1.2", "once": "~1.4.0", "opener": "^1.5.1", "osenv": "^0.1.5", - "pacote": "^9.5.0", + "pacote": "^9.5.8", "path-is-inside": "~1.0.2", "promise-inflight": "~1.0.1", "qrcode-terminal": "^0.12.0", - "query-string": "^6.2.0", + "query-string": "^6.8.2", "qw": "~1.0.1", "read": "~1.0.7", - "read-cmd-shim": "~1.0.1", + "read-cmd-shim": "^1.0.4", "read-installed": "~4.0.3", - "read-package-json": "^2.0.13", - "read-package-tree": "^5.2.2", - "readable-stream": "^3.1.1", - "readdir-scoped-modules": "*", + "read-package-json": "^2.1.0", + "read-package-tree": "^5.3.1", + "readable-stream": "^3.4.0", + "readdir-scoped-modules": "^1.1.0", "request": "^2.88.0", "retry": "^0.12.0", "rimraf": "^2.6.3", "safe-buffer": "^5.1.2", - "semver": "^5.6.0", - "sha": "~2.0.1", + "semver": "^5.7.1", + "sha": "^3.0.0", "slide": "~1.1.6", "sorted-object": "~2.0.1", "sorted-union-stream": "~2.1.3", "ssri": "^6.0.1", "stringify-package": "^1.0.0", - "tar": "^4.4.8", + "tar": "^4.4.10", "text-table": "~0.2.0", "tiny-relative-date": "^1.3.0", "uid-number": "0.0.6", @@ -1096,8 +1120,8 @@ "validate-npm-package-license": "^3.0.4", "validate-npm-package-name": "~3.0.0", "which": "^1.3.1", - "worker-farm": "^1.6.0", - "write-file-atomic": "^2.4.2" + "worker-farm": "^1.7.0", + "write-file-atomic": "^2.4.3" }, "dependencies": { "JSONStream": { @@ -1115,7 +1139,7 @@ "dev": true }, "agent-base": { - "version": "4.2.1", + "version": "4.3.0", "bundled": true, "dev": true, "requires": { @@ -1123,7 +1147,7 @@ } }, "agentkeepalive": { - "version": "3.4.1", + "version": "3.5.2", "bundled": true, "dev": true, "requires": { @@ -1263,27 +1287,19 @@ } }, "bin-links": { - "version": "1.1.2", + "version": "1.1.3", "bundled": true, "dev": true, "requires": { - "bluebird": "^3.5.0", - "cmd-shim": "^2.0.2", - "gentle-fs": "^2.0.0", - "graceful-fs": "^4.1.11", + "bluebird": "^3.5.3", + "cmd-shim": "^3.0.0", + "gentle-fs": "^2.0.1", + "graceful-fs": "^4.1.15", "write-file-atomic": "^2.3.0" } }, - "block-stream": { - "version": "0.0.9", - "bundled": true, - "dev": true, - "requires": { - "inherits": "~2.0.0" - } - }, "bluebird": { - "version": "3.5.3", + "version": "3.5.5", "bundled": true, "dev": true }, @@ -1331,56 +1347,29 @@ "dev": true }, "cacache": { - "version": "11.3.2", + "version": "12.0.3", "bundled": true, "dev": true, "requires": { - "bluebird": "^3.5.3", + "bluebird": "^3.5.5", "chownr": "^1.1.1", "figgy-pudding": "^3.5.1", - "glob": "^7.1.3", + "glob": "^7.1.4", "graceful-fs": "^4.1.15", + "infer-owner": "^1.0.3", "lru-cache": "^5.1.1", "mississippi": "^3.0.0", "mkdirp": "^0.5.1", "move-concurrently": "^1.0.1", "promise-inflight": "^1.0.1", - "rimraf": "^2.6.2", + "rimraf": "^2.6.3", "ssri": "^6.0.1", "unique-filename": "^1.1.1", "y18n": "^4.0.0" - }, - "dependencies": { - "chownr": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, - "lru-cache": { - "version": "5.1.1", - "bundled": true, - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, - "unique-filename": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "requires": { - "unique-slug": "^2.0.0" - } - }, - "yallist": { - "version": "3.0.3", - "bundled": true, - "dev": true - } } }, "call-limit": { - "version": "1.1.0", + "version": "1.1.1", "bundled": true, "dev": true }, @@ -1410,7 +1399,7 @@ } }, "chownr": { - "version": "1.1.1", + "version": "1.1.2", "bundled": true, "dev": true }, @@ -1482,7 +1471,7 @@ "dev": true }, "cmd-shim": { - "version": "2.0.2", + "version": "3.0.3", "bundled": true, "dev": true, "requires": { @@ -1649,6 +1638,22 @@ "lru-cache": "^4.0.1", "shebang-command": "^1.2.0", "which": "^1.2.9" + }, + "dependencies": { + "lru-cache": { + "version": "4.1.5", + "bundled": true, + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "yallist": { + "version": "2.1.2", + "bundled": true, + "dev": true + } } }, "crypto-random-string": { @@ -1712,6 +1717,14 @@ "clone": "^1.0.2" } }, + "define-properties": { + "version": "1.1.3", + "bundled": true, + "dev": true, + "requires": { + "object-keys": "^1.0.12" + } + }, "delayed-stream": { "version": "1.0.0", "bundled": true, @@ -1825,6 +1838,11 @@ "once": "^1.4.0" } }, + "env-paths": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, "err-code": { "version": "1.1.2", "bundled": true, @@ -1838,8 +1856,30 @@ "prr": "~1.0.1" } }, + "es-abstract": { + "version": "1.12.0", + "bundled": true, + "dev": true, + "requires": { + "es-to-primitive": "^1.1.1", + "function-bind": "^1.1.1", + "has": "^1.0.1", + "is-callable": "^1.1.3", + "is-regex": "^1.0.4" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "requires": { + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" + } + }, "es6-promise": { - "version": "4.2.6", + "version": "4.2.8", "bundled": true, "dev": true }, @@ -1997,7 +2037,7 @@ } }, "fs-minipass": { - "version": "1.2.5", + "version": "1.2.6", "bundled": true, "dev": true, "requires": { @@ -2059,16 +2099,10 @@ "bundled": true, "dev": true }, - "fstream": { - "version": "1.0.11", + "function-bind": { + "version": "1.1.1", "bundled": true, - "dev": true, - "requires": { - "graceful-fs": "^4.1.2", - "inherits": "~2.0.0", - "mkdirp": ">=0.5 0", - "rimraf": "2" - } + "dev": true }, "gauge": { "version": "2.7.4", @@ -2108,14 +2142,16 @@ "dev": true }, "gentle-fs": { - "version": "2.0.1", + "version": "2.2.1", "bundled": true, "dev": true, "requires": { "aproba": "^1.1.2", + "chownr": "^1.1.2", "fs-vacuum": "^1.2.10", "graceful-fs": "^4.1.11", "iferr": "^0.1.5", + "infer-owner": "^1.0.4", "mkdirp": "^0.5.1", "path-is-inside": "^1.0.2", "read-cmd-shim": "^1.0.1", @@ -2156,7 +2192,7 @@ } }, "glob": { - "version": "7.1.3", + "version": "7.1.4", "bundled": true, "dev": true, "requires": { @@ -2202,7 +2238,7 @@ } }, "graceful-fs": { - "version": "4.1.15", + "version": "4.2.2", "bundled": true, "dev": true }, @@ -2220,20 +2256,36 @@ "har-schema": "^2.0.0" } }, + "has": { + "version": "1.0.3", + "bundled": true, + "dev": true, + "requires": { + "function-bind": "^1.1.1" + } + }, "has-flag": { "version": "3.0.0", "bundled": true, "dev": true }, + "has-symbols": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, "has-unicode": { "version": "2.0.1", "bundled": true, "dev": true }, "hosted-git-info": { - "version": "2.7.1", + "version": "2.8.2", "bundled": true, - "dev": true + "dev": true, + "requires": { + "lru-cache": "^5.1.1" + } }, "http-cache-semantics": { "version": "3.8.1", @@ -2260,11 +2312,11 @@ } }, "https-proxy-agent": { - "version": "2.2.1", + "version": "2.2.2", "bundled": true, "dev": true, "requires": { - "agent-base": "^4.1.0", + "agent-base": "^4.3.0", "debug": "^3.1.0" } }, @@ -2307,6 +2359,11 @@ "bundled": true, "dev": true }, + "infer-owner": { + "version": "1.0.4", + "bundled": true, + "dev": true + }, "inflight": { "version": "1.0.6", "bundled": true, @@ -2317,7 +2374,7 @@ } }, "inherits": { - "version": "2.0.3", + "version": "2.0.4", "bundled": true, "dev": true }, @@ -2356,6 +2413,11 @@ "bundled": true, "dev": true }, + "is-callable": { + "version": "1.1.4", + "bundled": true, + "dev": true + }, "is-ci": { "version": "1.1.0", "bundled": true, @@ -2379,6 +2441,11 @@ "cidr-regex": "^2.0.10" } }, + "is-date-object": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, "is-fullwidth-code-point": { "version": "1.0.0", "bundled": true, @@ -2419,6 +2486,14 @@ "bundled": true, "dev": true }, + "is-regex": { + "version": "1.0.4", + "bundled": true, + "dev": true, + "requires": { + "has": "^1.0.1" + } + }, "is-retry-allowed": { "version": "1.1.0", "bundled": true, @@ -2429,6 +2504,14 @@ "bundled": true, "dev": true }, + "is-symbol": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "has-symbols": "^1.0.0" + } + }, "is-typedarray": { "version": "1.0.0", "bundled": true, @@ -2513,7 +2596,7 @@ } }, "libcipm": { - "version": "3.0.3", + "version": "4.0.3", "bundled": true, "dev": true, "requires": { @@ -2525,7 +2608,7 @@ "ini": "^1.3.5", "lock-verify": "^2.0.2", "mkdirp": "^0.5.1", - "npm-lifecycle": "^2.0.3", + "npm-lifecycle": "^3.0.0", "npm-logical-tree": "^1.2.1", "npm-package-arg": "^6.1.0", "pacote": "^9.1.0", @@ -2535,48 +2618,41 @@ } }, "libnpm": { - "version": "2.0.1", + "version": "3.0.1", "bundled": true, "dev": true, "requires": { "bin-links": "^1.1.2", "bluebird": "^3.5.3", "find-npm-prefix": "^1.0.2", - "libnpmaccess": "^3.0.1", + "libnpmaccess": "^3.0.2", "libnpmconfig": "^1.2.1", - "libnpmhook": "^5.0.2", - "libnpmorg": "^1.0.0", - "libnpmpublish": "^1.1.0", - "libnpmsearch": "^2.0.0", - "libnpmteam": "^1.0.1", + "libnpmhook": "^5.0.3", + "libnpmorg": "^1.0.1", + "libnpmpublish": "^1.1.2", + "libnpmsearch": "^2.0.2", + "libnpmteam": "^1.0.2", "lock-verify": "^2.0.2", - "npm-lifecycle": "^2.1.0", + "npm-lifecycle": "^3.0.0", "npm-logical-tree": "^1.2.1", "npm-package-arg": "^6.1.0", - "npm-profile": "^4.0.1", - "npm-registry-fetch": "^3.8.0", + "npm-profile": "^4.0.2", + "npm-registry-fetch": "^4.0.0", "npmlog": "^4.1.2", - "pacote": "^9.2.3", + "pacote": "^9.5.3", "read-package-json": "^2.0.13", "stringify-package": "^1.0.0" } }, "libnpmaccess": { - "version": "3.0.1", + "version": "3.0.2", "bundled": true, "dev": true, "requires": { "aproba": "^2.0.0", "get-stream": "^4.0.0", "npm-package-arg": "^6.1.0", - "npm-registry-fetch": "^3.8.0" - }, - "dependencies": { - "aproba": { - "version": "2.0.0", - "bundled": true, - "dev": true - } + "npm-registry-fetch": "^4.0.0" } }, "libnpmconfig": { @@ -2607,7 +2683,7 @@ } }, "p-limit": { - "version": "2.1.0", + "version": "2.2.0", "bundled": true, "dev": true, "requires": { @@ -2623,43 +2699,36 @@ } }, "p-try": { - "version": "2.0.0", + "version": "2.2.0", "bundled": true, "dev": true } } }, "libnpmhook": { - "version": "5.0.2", + "version": "5.0.3", "bundled": true, "dev": true, "requires": { "aproba": "^2.0.0", "figgy-pudding": "^3.4.1", "get-stream": "^4.0.0", - "npm-registry-fetch": "^3.8.0" + "npm-registry-fetch": "^4.0.0" } }, "libnpmorg": { - "version": "1.0.0", + "version": "1.0.1", "bundled": true, "dev": true, "requires": { "aproba": "^2.0.0", "figgy-pudding": "^3.4.1", "get-stream": "^4.0.0", - "npm-registry-fetch": "^3.8.0" - }, - "dependencies": { - "aproba": { - "version": "2.0.0", - "bundled": true, - "dev": true - } + "npm-registry-fetch": "^4.0.0" } }, "libnpmpublish": { - "version": "1.1.1", + "version": "1.1.2", "bundled": true, "dev": true, "requires": { @@ -2669,37 +2738,30 @@ "lodash.clonedeep": "^4.5.0", "normalize-package-data": "^2.4.0", "npm-package-arg": "^6.1.0", - "npm-registry-fetch": "^3.8.0", + "npm-registry-fetch": "^4.0.0", "semver": "^5.5.1", "ssri": "^6.0.1" } }, "libnpmsearch": { - "version": "2.0.0", + "version": "2.0.2", "bundled": true, "dev": true, "requires": { "figgy-pudding": "^3.5.1", "get-stream": "^4.0.0", - "npm-registry-fetch": "^3.8.0" + "npm-registry-fetch": "^4.0.0" } }, "libnpmteam": { - "version": "1.0.1", + "version": "1.0.2", "bundled": true, "dev": true, "requires": { "aproba": "^2.0.0", "figgy-pudding": "^3.4.1", "get-stream": "^4.0.0", - "npm-registry-fetch": "^3.8.0" - }, - "dependencies": { - "aproba": { - "version": "2.0.0", - "bundled": true, - "dev": true - } + "npm-registry-fetch": "^4.0.0" } }, "libnpx": { @@ -2821,12 +2883,11 @@ "dev": true }, "lru-cache": { - "version": "4.1.5", + "version": "5.1.1", "bundled": true, "dev": true, "requires": { - "pseudomap": "^1.0.2", - "yallist": "^2.1.2" + "yallist": "^3.0.2" } }, "make-dir": { @@ -2838,16 +2899,16 @@ } }, "make-fetch-happen": { - "version": "4.0.1", + "version": "5.0.0", "bundled": true, "dev": true, "requires": { "agentkeepalive": "^3.4.1", - "cacache": "^11.0.1", + "cacache": "^12.0.0", "http-cache-semantics": "^3.8.1", "http-proxy-agent": "^2.1.0", "https-proxy-agent": "^2.2.1", - "lru-cache": "^4.1.2", + "lru-cache": "^5.1.1", "mississippi": "^3.0.0", "node-fetch-npm": "^2.0.2", "promise-retry": "^1.1.1", @@ -2916,7 +2977,7 @@ } }, "minizlib": { - "version": "1.1.1", + "version": "1.2.1", "bundled": true, "dev": true, "requires": { @@ -2989,21 +3050,20 @@ } }, "node-gyp": { - "version": "3.8.0", + "version": "5.0.3", "bundled": true, "dev": true, "requires": { - "fstream": "^1.0.0", + "env-paths": "^1.0.0", "glob": "^7.0.3", "graceful-fs": "^4.1.2", "mkdirp": "^0.5.0", "nopt": "2 || 3", "npmlog": "0 || 1 || 2 || 3 || 4", - "osenv": "0", "request": "^2.87.0", "rimraf": "2", "semver": "~5.3.0", - "tar": "^2.0.0", + "tar": "^4.4.8", "which": "1" }, "dependencies": { @@ -3019,16 +3079,6 @@ "version": "5.3.0", "bundled": true, "dev": true - }, - "tar": { - "version": "2.2.1", - "bundled": true, - "dev": true, - "requires": { - "block-stream": "*", - "fstream": "^1.0.2", - "inherits": "2" - } } } }, @@ -3090,13 +3140,13 @@ } }, "npm-lifecycle": { - "version": "2.1.0", + "version": "3.1.3", "bundled": true, "dev": true, "requires": { "byline": "^5.0.0", - "graceful-fs": "^4.1.11", - "node-gyp": "^3.8.0", + "graceful-fs": "^4.1.15", + "node-gyp": "^5.0.2", "resolve-from": "^4.0.0", "slide": "^1.1.6", "uid-number": "0.0.6", @@ -3110,18 +3160,18 @@ "dev": true }, "npm-package-arg": { - "version": "6.1.0", + "version": "6.1.1", "bundled": true, "dev": true, "requires": { - "hosted-git-info": "^2.6.0", + "hosted-git-info": "^2.7.1", "osenv": "^0.1.5", - "semver": "^5.5.0", + "semver": "^5.6.0", "validate-npm-package-name": "^3.0.0" } }, "npm-packlist": { - "version": "1.4.1", + "version": "1.4.4", "bundled": true, "dev": true, "requires": { @@ -3130,7 +3180,7 @@ } }, "npm-pick-manifest": { - "version": "2.2.3", + "version": "3.0.2", "bundled": true, "dev": true, "requires": { @@ -3140,25 +3190,25 @@ } }, "npm-profile": { - "version": "4.0.1", + "version": "4.0.2", "bundled": true, "dev": true, "requires": { "aproba": "^1.1.2 || 2", "figgy-pudding": "^3.4.1", - "npm-registry-fetch": "^3.8.0" + "npm-registry-fetch": "^4.0.0" } }, "npm-registry-fetch": { - "version": "3.9.0", + "version": "4.0.0", "bundled": true, "dev": true, "requires": { "JSONStream": "^1.3.4", "bluebird": "^3.5.1", "figgy-pudding": "^3.4.1", - "lru-cache": "^4.1.3", - "make-fetch-happen": "^4.0.1", + "lru-cache": "^5.1.1", + "make-fetch-happen": "^5.0.0", "npm-package-arg": "^6.1.0" } }, @@ -3201,6 +3251,20 @@ "bundled": true, "dev": true }, + "object-keys": { + "version": "1.0.12", + "bundled": true, + "dev": true + }, + "object.getownpropertydescriptors": { + "version": "2.0.3", + "bundled": true, + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "es-abstract": "^1.5.1" + } + }, "once": { "version": "1.4.0", "bundled": true, @@ -3281,17 +3345,19 @@ } }, "pacote": { - "version": "9.5.0", + "version": "9.5.8", "bundled": true, "dev": true, "requires": { "bluebird": "^3.5.3", - "cacache": "^11.3.2", + "cacache": "^12.0.2", + "chownr": "^1.1.2", "figgy-pudding": "^3.5.1", "get-stream": "^4.1.0", "glob": "^7.1.3", + "infer-owner": "^1.0.4", "lru-cache": "^5.1.1", - "make-fetch-happen": "^4.0.1", + "make-fetch-happen": "^5.0.0", "minimatch": "^3.0.4", "minipass": "^2.3.5", "mississippi": "^3.0.0", @@ -3299,8 +3365,8 @@ "normalize-package-data": "^2.4.0", "npm-package-arg": "^6.1.0", "npm-packlist": "^1.1.12", - "npm-pick-manifest": "^2.2.3", - "npm-registry-fetch": "^3.8.0", + "npm-pick-manifest": "^3.0.0", + "npm-registry-fetch": "^4.0.0", "osenv": "^0.1.5", "promise-inflight": "^1.0.1", "promise-retry": "^1.1.1", @@ -3309,19 +3375,11 @@ "safe-buffer": "^5.1.2", "semver": "^5.6.0", "ssri": "^6.0.1", - "tar": "^4.4.8", + "tar": "^4.4.10", "unique-filename": "^1.1.1", "which": "^1.3.1" }, "dependencies": { - "lru-cache": { - "version": "5.1.1", - "bundled": true, - "dev": true, - "requires": { - "yallist": "^3.0.2" - } - }, "minipass": { "version": "2.3.5", "bundled": true, @@ -3330,11 +3388,6 @@ "safe-buffer": "^5.1.2", "yallist": "^3.0.0" } - }, - "yallist": { - "version": "3.0.3", - "bundled": true, - "dev": true } } }, @@ -3520,11 +3573,12 @@ "dev": true }, "query-string": { - "version": "6.2.0", + "version": "6.8.2", "bundled": true, "dev": true, "requires": { "decode-uri-component": "^0.2.0", + "split-on-first": "^1.0.0", "strict-uri-encode": "^2.0.0" } }, @@ -3560,7 +3614,7 @@ } }, "read-cmd-shim": { - "version": "1.0.1", + "version": "1.0.4", "bundled": true, "dev": true, "requires": { @@ -3582,7 +3636,7 @@ } }, "read-package-json": { - "version": "2.0.13", + "version": "2.1.0", "bundled": true, "dev": true, "requires": { @@ -3594,19 +3648,17 @@ } }, "read-package-tree": { - "version": "5.2.2", + "version": "5.3.1", "bundled": true, "dev": true, "requires": { - "debuglog": "^1.0.1", - "dezalgo": "^1.0.0", - "once": "^1.3.0", "read-package-json": "^2.0.0", - "readdir-scoped-modules": "^1.0.0" + "readdir-scoped-modules": "^1.0.0", + "util-promisify": "^2.1.0" } }, "readable-stream": { - "version": "3.1.1", + "version": "3.4.0", "bundled": true, "dev": true, "requires": { @@ -3616,7 +3668,7 @@ } }, "readdir-scoped-modules": { - "version": "1.0.2", + "version": "1.1.0", "bundled": true, "dev": true, "requires": { @@ -3724,7 +3776,7 @@ "dev": true }, "semver": { - "version": "5.6.0", + "version": "5.7.1", "bundled": true, "dev": true }, @@ -3742,36 +3794,11 @@ "dev": true }, "sha": { - "version": "2.0.1", + "version": "3.0.0", "bundled": true, "dev": true, "requires": { - "graceful-fs": "^4.1.2", - "readable-stream": "^2.0.2" - }, - "dependencies": { - "readable-stream": { - "version": "2.3.6", - "bundled": true, - "dev": true, - "requires": { - "core-util-is": "~1.0.0", - "inherits": "~2.0.3", - "isarray": "~1.0.0", - "process-nextick-args": "~2.0.0", - "safe-buffer": "~5.1.1", - "string_decoder": "~1.1.1", - "util-deprecate": "~1.0.1" - } - }, - "string_decoder": { - "version": "1.1.1", - "bundled": true, - "dev": true, - "requires": { - "safe-buffer": "~5.1.0" - } - } + "graceful-fs": "^4.1.2" } }, "shebang-command": { @@ -3803,26 +3830,36 @@ "dev": true }, "smart-buffer": { - "version": "4.0.1", + "version": "4.0.2", "bundled": true, "dev": true }, "socks": { - "version": "2.2.0", + "version": "2.3.2", "bundled": true, "dev": true, "requires": { "ip": "^1.1.5", - "smart-buffer": "^4.0.1" + "smart-buffer": "4.0.2" } }, "socks-proxy-agent": { - "version": "4.0.1", + "version": "4.0.2", "bundled": true, "dev": true, "requires": { - "agent-base": "~4.2.0", - "socks": "~2.2.0" + "agent-base": "~4.2.1", + "socks": "~2.3.2" + }, + "dependencies": { + "agent-base": { + "version": "4.2.1", + "bundled": true, + "dev": true, + "requires": { + "es6-promisify": "^5.0.0" + } + } } }, "sorted-object": { @@ -3899,6 +3936,11 @@ "bundled": true, "dev": true }, + "split-on-first": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, "sshpk": { "version": "1.14.2", "bundled": true, @@ -4044,24 +4086,19 @@ } }, "tar": { - "version": "4.4.8", + "version": "4.4.10", "bundled": true, "dev": true, "requires": { "chownr": "^1.1.1", "fs-minipass": "^1.2.5", - "minipass": "^2.3.4", - "minizlib": "^1.1.1", + "minipass": "^2.3.5", + "minizlib": "^1.2.1", "mkdirp": "^0.5.0", "safe-buffer": "^5.1.2", - "yallist": "^3.0.2" + "yallist": "^3.0.3" }, "dependencies": { - "chownr": { - "version": "1.1.1", - "bundled": true, - "dev": true - }, "minipass": { "version": "2.3.5", "bundled": true, @@ -4246,6 +4283,14 @@ "bundled": true, "dev": true }, + "util-promisify": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "object.getownpropertydescriptors": "^2.0.3" + } + }, "uuid": { "version": "3.3.2", "bundled": true, @@ -4328,7 +4373,7 @@ } }, "worker-farm": { - "version": "1.6.0", + "version": "1.7.0", "bundled": true, "dev": true, "requires": { @@ -4362,7 +4407,7 @@ "dev": true }, "write-file-atomic": { - "version": "2.4.2", + "version": "2.4.3", "bundled": true, "dev": true, "requires": { @@ -4387,7 +4432,7 @@ "dev": true }, "yallist": { - "version": "2.1.2", + "version": "3.0.3", "bundled": true, "dev": true }, @@ -4641,6 +4686,50 @@ "strip-indent": "^1.0.1" } }, + "regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "dev": true + }, + "regenerate-unicode-properties": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz", + "integrity": "sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA==", + "dev": true, + "requires": { + "regenerate": "^1.4.0" + } + }, + "regexpu-core": { + "version": "4.5.5", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.5.5.tgz", + "integrity": "sha512-FpI67+ky9J+cDizQUJlIlNZFKual/lUkFr1AG6zOCpwZ9cLrg8UUVakyUQJD7fCDIe9Z2nwTQJNPyonatNmDFQ==", + "dev": true, + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.1.0", + "regjsgen": "^0.5.0", + "regjsparser": "^0.6.0", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.1.0" + } + }, + "regjsgen": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz", + "integrity": "sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA==", + "dev": true + }, + "regjsparser": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz", + "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + } + }, "repeating": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/repeating/-/repeating-2.0.1.tgz", @@ -4719,13 +4808,13 @@ } }, "rollup-plugin-buble": { - "version": "0.19.2", - "resolved": "https://registry.npmjs.org/rollup-plugin-buble/-/rollup-plugin-buble-0.19.2.tgz", - "integrity": "sha512-dxK0prR8j/7qhI2EZDz/evKCRuhuZMpRlUGPrRWmpg5/2V8tP1XFW+Uk0WfxyNgFfJHvy0GmxnJSTb5dIaNljQ==", + "version": "0.19.8", + "resolved": "https://registry.npmjs.org/rollup-plugin-buble/-/rollup-plugin-buble-0.19.8.tgz", + "integrity": "sha512-8J4zPk2DQdk3rxeZvxgzhHh/rm5nJkjwgcsUYisCQg1QbT5yagW+hehYEW7ZNns/NVbDCTv4JQ7h4fC8qKGOKw==", "dev": true, "requires": { - "buble": "^0.19.2", - "rollup-pluginutils": "^2.0.1" + "buble": "^0.19.8", + "rollup-pluginutils": "^2.3.3" } }, "rollup-plugin-commonjs": { @@ -4980,9 +5069,9 @@ } }, "supports-color": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.2.0.tgz", - "integrity": "sha512-F39vS48la4YvTZUPVeTqsjsFNrvcMwrV3RLZINsmHo+7djCvuUzSIeXOnZ5hmjef4bajL1dNccN+tg5XAliO5Q==", + "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" @@ -5048,9 +5137,9 @@ "dev": true }, "typescript": { - "version": "3.2.2", - "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.2.2.tgz", - "integrity": "sha512-VCj5UiSyHBjwfYacmDuc/NOk4QQixbE+Wn7MFJuS0nRuPQbof132Pw4u53dm264O8LPc2MVsc7RJNml5szurkg==", + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/typescript/-/typescript-3.6.2.tgz", + "integrity": "sha512-lmQ4L+J6mnu3xweP8+rOrUwzmN+MRAj7TgtJtDaXE5PMyX2kCrklhg3rvOsOIfNeAWMQWO2F1GPc1kMD2vLAfw==", "dev": true }, "uglify-es": { @@ -5063,6 +5152,34 @@ "source-map": "~0.6.1" } }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz", + "integrity": "sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g==", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz", + "integrity": "sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw==", + "dev": true + }, "uri-js": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", @@ -5105,27 +5222,21 @@ "extsprintf": "^1.2.0" } }, - "vlq": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/vlq/-/vlq-1.0.0.tgz", - "integrity": "sha512-o3WmXySo+oI5thgqr7Qy8uBkT/v9Zr+sRyrh1lr8aWPUkgDWdWt4Nae2WKBrLsocgE8BuWWD0jLc+VW8LeU+2g==", - "dev": true - }, "vue": { - "version": "2.5.20", - "resolved": "https://registry.npmjs.org/vue/-/vue-2.5.20.tgz", - "integrity": "sha512-kVLZi8RWOk8qwAt+a0bVDy9VV5Zzcnj0fLCMyKLx1dmEBjqmYJYRWHvPwiypiJBtJkdmROy5NP5hyDqTdfBcvQ==", + "version": "2.6.10", + "resolved": "https://registry.npmjs.org/vue/-/vue-2.6.10.tgz", + "integrity": "sha512-ImThpeNU9HbdZL3utgMCq0oiMzAkt1mcgy3/E6zWC/G6AaQoeuFdsl9nDhTDU3X1R6FK7nsIUuRACVcjI+A2GQ==", "dev": true }, "vue-class-component": { - "version": "7.0.2", - "resolved": "https://registry.npmjs.org/vue-class-component/-/vue-class-component-7.0.2.tgz", - "integrity": "sha512-8xw/wkZI2tgHcwvkSRC1ax7GeP1CG27wKhedvOAdjdASm05VU4RijGsCYti6s6CzBioBL5BQUmntQQTCsp1wnQ==" + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/vue-class-component/-/vue-class-component-7.1.0.tgz", + "integrity": "sha512-G9152NzUkz0i0xTfhk0Afc8vzdXxDR1pfN4dTwE72cskkgJtdXfrKBkMfGvDuxUh35U500g5Ve4xL8PEGdWeHg==" }, "vuex": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.0.1.tgz", - "integrity": "sha512-wLoqz0B7DSZtgbWL1ShIBBCjv22GV5U+vcBFox658g6V0s4wZV9P4YjCNyoHSyIBpj1f29JBoNQIqD82cR4O3w==", + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/vuex/-/vuex-3.1.1.tgz", + "integrity": "sha512-ER5moSbLZuNSMBFnEBVGhQ1uCBNJslH9W/Dw2W7GZN23UQA69uapP5GTT9Vm8Trc0PzBSVt6LzF3hGjmv41xcg==", "dev": true }, "which": { diff --git a/package.json b/package.json index 5a5c255..6a1d5ef 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "vuex-pathify", - "version": "1.3.0", + "version": "1.4.0", "description": "Ridiculously simple Vuex setup + wiring", "main": "dist/vuex-pathify.js", "module": "dist/vuex-pathify.esm.js", @@ -32,20 +32,20 @@ "url": "https://github.com/davestewart/vuex-pathify/issues" }, "dependencies": { - "vue-class-component": "^7.0.2" + "vue-class-component": "^7.1.0" }, "devDependencies": { "install": "^0.12.2", "node-sass": "^4.12.0", - "npm": "^6.9.0", + "npm": "^6.11.3", "rollup": "^0.67.4", - "rollup-plugin-buble": "^0.19.1", + "rollup-plugin-buble": "^0.19.8", "rollup-plugin-commonjs": "^8.4.1", "rollup-plugin-license": "^0.9.0", "rollup-plugin-uglify": "^3.0.0", - "typescript": "^3.2.2", - "vue": "^2.5.20", - "vuex": "^3.0.1" + "typescript": "^3.6.2", + "vue": "^2.6.10", + "vuex": "^3.1.1" }, "peerDependencies": { "vue": "^2.5.19", diff --git a/src/helpers/component.js b/src/helpers/component.js index 8e5669a..5f5f32f 100644 --- a/src/helpers/component.js +++ b/src/helpers/component.js @@ -121,7 +121,7 @@ export function getOne (path, stateOnly) { store = this.$store getter = makeGetter(store, path, stateOnly) } - return getter(...args) + return getter.call(this, ...args) } } @@ -139,7 +139,7 @@ export function setOne (path) { setter = makeSetter(store, path) } this.$nextTick(() => this.$emit('sync', path, value)) - return setter(value) + return setter.call(this, value) } } diff --git a/src/services/resolver.js b/src/services/resolver.js index 5116921..15372de 100644 --- a/src/services/resolver.js +++ b/src/services/resolver.js @@ -128,6 +128,7 @@ export function resolve (store, path) { module: modPath, target: statePath, name: trgName.replace('!', ''), + isDynamic: path.includes(':'), /** * Returns properties about the targeted member diff --git a/src/services/store.js b/src/services/store.js index 5c15909..9368710 100644 --- a/src/services/store.js +++ b/src/services/store.js @@ -27,9 +27,14 @@ export function makeSetter (store, path) { } } - const mutation = resolver.get('mutations') - if (mutation.exists) { + let mutation = resolver.get('mutations') + if (mutation.exists || resolver.isDynamic) { return function (value) { + // rebuild mutation if using dynamic path + if (resolver.isDynamic) { + const interpolated = interpolate(path, this) + mutation = resolve(store, interpolated).get('mutations') + } const payload = mutation.objPath ? new Payload(path, mutation.objPath, value) : value @@ -74,9 +79,12 @@ export function makeGetter (store, path, stateOnly) { } const state = resolver.get('state') - if (state.exists) { + if (state.exists || resolver.isDynamic) { return function () { - return getValueIfEnabled(path, store.state, resolver.absPath) + const absPath = resolver.isDynamic + ? interpolate(resolver.absPath, this) + : resolver.absPath + return getValueIfEnabled(path, store.state, absPath) } } @@ -103,3 +111,18 @@ function getValueIfEnabled(expr, source, path) { } return getValue(source, path) } + +/** + * Utility function to interpolate a string with properties + * @param {string} path The path containing interpolation :tokens + * @param {object} scope The scope containing properties to be used + * @return {string} + */ +function interpolate (path, scope) { + return path.replace(/:(\w+)/g, function replace (all, token) { + if (!(token in scope)) { + console.error(`Error resolving dynamic store path: The property "${token}" does not exist on the scope`, scope) + } + return scope[token] + }) +}