update
This commit is contained in:
+3
-1
@@ -35,6 +35,7 @@ declare const dotProp: {
|
||||
@param object - Object to set the `path` value.
|
||||
@param path - Path of the property in the object, using `.` to separate each nested key. Use `\\.` if you have a `.` in the key.
|
||||
@param value - Value to set at `path`.
|
||||
@returns The object.
|
||||
|
||||
@example
|
||||
```
|
||||
@@ -77,6 +78,7 @@ declare const dotProp: {
|
||||
/**
|
||||
@param object - Object to delete the `path` value.
|
||||
@param path - Path of the property in the object, using `.` to separate each nested key. Use `\\.` if you have a `.` in the key.
|
||||
@returns A boolean of whether the property existed before being deleted.
|
||||
|
||||
@example
|
||||
```
|
||||
@@ -93,7 +95,7 @@ declare const dotProp: {
|
||||
//=> {foo: {bar: {y: 'x'}}}
|
||||
```
|
||||
*/
|
||||
delete(object: {[key: string]: any}, path: string): void;
|
||||
delete(object: {[key: string]: any}, path: string): boolean;
|
||||
};
|
||||
|
||||
export = dotProp;
|
||||
|
||||
+3
-3
@@ -93,7 +93,7 @@ module.exports = {
|
||||
|
||||
delete(object, path) {
|
||||
if (!isObj(object) || typeof path !== 'string') {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
|
||||
const pathArray = getPathSegments(path);
|
||||
@@ -103,13 +103,13 @@ module.exports = {
|
||||
|
||||
if (i === pathArray.length - 1) {
|
||||
delete object[p];
|
||||
return;
|
||||
return true;
|
||||
}
|
||||
|
||||
object = object[p];
|
||||
|
||||
if (!isObj(object)) {
|
||||
return;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
},
|
||||
|
||||
+12
-12
@@ -1,34 +1,34 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"dot-prop@5.2.0",
|
||||
"/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series"
|
||||
"dot-prop@5.3.0",
|
||||
"/home/node/nuxt"
|
||||
]
|
||||
],
|
||||
"_from": "dot-prop@5.2.0",
|
||||
"_id": "dot-prop@5.2.0",
|
||||
"_from": "dot-prop@5.3.0",
|
||||
"_id": "dot-prop@5.3.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-uEUyaDKoSQ1M4Oq8l45hSE26SnTxL6snNnqvK/VWx5wJhmff5z0FUVJDKDanor/6w3kzE3i7XZOk+7wC0EXr1A==",
|
||||
"_integrity": "sha512-QM8q3zDe58hqUqjraQOmzZ1LIH9SWQJTlEKCH4kJ2oQvLZk7RbQXvtDM2XEq3fwkV9CCvvH4LA0AV+ogFsBM2Q==",
|
||||
"_location": "/dot-prop",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "dot-prop@5.2.0",
|
||||
"raw": "dot-prop@5.3.0",
|
||||
"name": "dot-prop",
|
||||
"escapedName": "dot-prop",
|
||||
"rawSpec": "5.2.0",
|
||||
"rawSpec": "5.3.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "5.2.0"
|
||||
"fetchSpec": "5.3.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/postcss-merge-rules/postcss-selector-parser",
|
||||
"/postcss-minify-selectors/postcss-selector-parser",
|
||||
"/stylehacks/postcss-selector-parser"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.2.0.tgz",
|
||||
"_spec": "5.2.0",
|
||||
"_where": "/mnt/Foxconn/Digitalent/Deverloper/liff-push_2series",
|
||||
"_resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.3.0.tgz",
|
||||
"_spec": "5.3.0",
|
||||
"_where": "/home/node/nuxt",
|
||||
"author": {
|
||||
"name": "Sindre Sorhus",
|
||||
"email": "sindresorhus@gmail.com",
|
||||
@@ -78,5 +78,5 @@
|
||||
"bench": "node bench.js",
|
||||
"test": "xo && ava && tsd"
|
||||
},
|
||||
"version": "5.2.0"
|
||||
"version": "5.3.0"
|
||||
}
|
||||
|
||||
+2
@@ -71,6 +71,8 @@ Returns the object.
|
||||
|
||||
### delete(object, path)
|
||||
|
||||
Returns a boolean of whether the property existed before being deleted.
|
||||
|
||||
#### object
|
||||
|
||||
Type: `object`
|
||||
|
||||
Reference in New Issue
Block a user