updated npm modules
This commit is contained in:
+10
@@ -1,5 +1,15 @@
|
||||
# Changelog
|
||||
|
||||
## 5.2.1
|
||||
|
||||
- Chore: Upgrade `js-yaml` to avoid npm audit warning.
|
||||
|
||||
## 5.2.0
|
||||
|
||||
- Added: `packageProp` values can be arrays of strings, to allow for property names that include periods. (This was possible before, but not documented or deliberately supported.)
|
||||
- Chore: Replaced the `lodash.get` dependency with a locally defined function.
|
||||
- Chore: Upgrade `js-yaml` to avoid npm audit warning.
|
||||
|
||||
## 5.1.0
|
||||
|
||||
- Added: `packageProp` values can include periods to describe paths to nested objects within `package.json`.
|
||||
|
||||
+27
-2
@@ -405,12 +405,14 @@ Examples:
|
||||
|
||||
### packageProp
|
||||
|
||||
Type: `string`.
|
||||
Type: `string | Array<string>`.
|
||||
Default: `` `${moduleName}` ``.
|
||||
|
||||
Name of the property in `package.json` to look for.
|
||||
|
||||
Use periods to describe a path to nested properties. For example, the value `'configs.myPackage'` will get you the `"myPackage"` value in a `package.json` like this:
|
||||
Use a period-delimited string or an array of strings to describe a path to nested properties.
|
||||
|
||||
For example, the value `'configs.myPackage'` or `['configs', 'myPackage']` will get you the `"myPackage"` value in a `package.json` like this:
|
||||
|
||||
```json
|
||||
{
|
||||
@@ -420,6 +422,29 @@ Use periods to describe a path to nested properties. For example, the value `'co
|
||||
}
|
||||
```
|
||||
|
||||
If nested property names within the path include periods, you need to use an array of strings. For example, the value `['configs', 'foo.bar', 'baz']` will get you the `"baz"` value in a `package.json` like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"configs": {
|
||||
"foo.bar": {
|
||||
"baz": {..}
|
||||
}
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
If a string includes period but corresponds to a top-level property name, it will not be interpreted as a period-delimited path. For example, the value `'one.two'` will get you the `"three"` value in a `package.json` like this:
|
||||
|
||||
```json
|
||||
{
|
||||
"one.two": "three",
|
||||
"one": {
|
||||
"two": "four"
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
### stopDir
|
||||
|
||||
Type: `string`.
|
||||
|
||||
+5
-2
@@ -2,11 +2,11 @@
|
||||
'use strict';
|
||||
|
||||
const path = require('path');
|
||||
const get = require('lodash.get');
|
||||
const loaders = require('./loaders');
|
||||
const readFile = require('./readFile');
|
||||
const cacheWrapper = require('./cacheWrapper');
|
||||
const getDirectory = require('./getDirectory');
|
||||
const getPropertyByPath = require('./getPropertyByPath');
|
||||
|
||||
const MODE_SYNC = 'sync';
|
||||
|
||||
@@ -174,7 +174,10 @@ class Explorer {
|
||||
|
||||
loadPackageProp(filepath , content ) {
|
||||
const parsedContent = loaders.loadJson(filepath, content);
|
||||
const packagePropValue = get(parsedContent, this.config.packageProp);
|
||||
const packagePropValue = getPropertyByPath(
|
||||
parsedContent,
|
||||
this.config.packageProp
|
||||
);
|
||||
return packagePropValue || null;
|
||||
}
|
||||
|
||||
|
||||
+6
-7
@@ -1,8 +1,8 @@
|
||||
{
|
||||
"_from": "cosmiconfig@^5.0.0",
|
||||
"_id": "cosmiconfig@5.1.0",
|
||||
"_id": "cosmiconfig@5.2.1",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-kCNPvthka8gvLtzAxQXvWo4FxqRB+ftRZyPZNuab5ngvM9Y7yw7hbEysglptLgpkGX9nAOKTBVkHUAe8xtYR6Q==",
|
||||
"_integrity": "sha512-H65gsXo1SKjf8zmrJ67eJk8aIRKV5ff2D4uKZIBZShbhGSpEmsQOPW/SKMKYhSTrqR7ufy6RP69rPogdaPh/kA==",
|
||||
"_location": "/cosmiconfig",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
@@ -18,8 +18,8 @@
|
||||
"_requiredBy": [
|
||||
"/cssnano"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.1.0.tgz",
|
||||
"_shasum": "6c5c35e97f37f985061cdf653f114784231185cf",
|
||||
"_resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-5.2.1.tgz",
|
||||
"_shasum": "040f726809c591e77a17c0a3626ca45b4f168b1a",
|
||||
"_spec": "cosmiconfig@^5.0.0",
|
||||
"_where": "C:\\xampp\\htdocs\\w4rpservices\\node_modules\\cssnano",
|
||||
"author": {
|
||||
@@ -48,8 +48,7 @@
|
||||
"dependencies": {
|
||||
"import-fresh": "^2.0.0",
|
||||
"is-directory": "^0.3.1",
|
||||
"js-yaml": "^3.9.0",
|
||||
"lodash.get": "^4.4.2",
|
||||
"js-yaml": "^3.13.1",
|
||||
"parse-json": "^4.0.0"
|
||||
},
|
||||
"deprecated": false,
|
||||
@@ -145,5 +144,5 @@
|
||||
"test": "jest --coverage",
|
||||
"test:watch": "jest --watch"
|
||||
},
|
||||
"version": "5.1.0"
|
||||
"version": "5.2.1"
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user