Comparing version 9.3.0 to 9.3.1
@@ -1,8 +0,27 @@ | ||
import get from 'lodash.get'; | ||
import set from 'lodash.set'; | ||
const _ = { | ||
set: (obj, path = '', value) => { | ||
let pointer = obj; | ||
path.split('.').forEach((key, index, arr) => { | ||
if (key === '__proto__' || key === 'constructor') return; | ||
const _ = { | ||
set, | ||
get, | ||
if (index === arr.length - 1) { | ||
pointer[key] = value; | ||
} else if (!(key in pointer)) { | ||
pointer[key] = {}; | ||
} | ||
pointer = pointer[key]; | ||
}); | ||
}, | ||
get: (obj, path = '', defaultValue) => { | ||
const travel = (regexp) => | ||
String.prototype.split | ||
.call(path, regexp) | ||
.filter(Boolean) | ||
.reduce((res, key) => (res !== null && res !== undefined ? res[key] : res), obj); | ||
const result = travel(/[,[\]]+?/) || travel(/[,.[\]]+?/); | ||
return result === undefined || result === obj ? defaultValue : result; | ||
}, | ||
}; | ||
import { | ||
@@ -9,0 +28,0 @@ defer, |
{ | ||
"name": "inquirer", | ||
"type": "module", | ||
"version": "9.3.0", | ||
"version": "9.3.1", | ||
"description": "A collection of common interactive command line user interfaces.", | ||
@@ -66,4 +66,2 @@ "author": "Simon Boudrias <admin@simonboudrias.com>", | ||
"external-editor": "^3.1.0", | ||
"lodash.get": "^4.4.2", | ||
"lodash.set": "^4.3.2", | ||
"mute-stream": "1.0.0", | ||
@@ -80,3 +78,3 @@ "ora": "^5.4.1", | ||
"sideEffects": false, | ||
"gitHead": "d5f62c6ee3e671f7d1b776b85d43781869d70918" | ||
"gitHead": "88696949e4646034cde7b85d57df0c211a5a492f" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
89604
12
2180
- Removedlodash.get@^4.4.2
- Removedlodash.set@^4.3.2
- Removedlodash.get@4.4.2(transitive)
- Removedlodash.set@4.3.2(transitive)