dot-prop
Advanced tools
Comparing version 5.2.0 to 5.3.0
@@ -38,2 +38,3 @@ declare const dotProp: { | ||
@param value - Value to set at `path`. | ||
@returns The object. | ||
@@ -81,2 +82,3 @@ @example | ||
@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. | ||
@@ -98,5 +100,5 @@ @example | ||
*/ | ||
delete(object: {[key: string]: any}, path: string): void; | ||
delete(object: {[key: string]: any}, path: string): boolean; | ||
}; | ||
export = dotProp; |
@@ -96,3 +96,3 @@ 'use strict'; | ||
if (!isObj(object) || typeof path !== 'string') { | ||
return; | ||
return false; | ||
} | ||
@@ -107,3 +107,3 @@ | ||
delete object[p]; | ||
return; | ||
return true; | ||
} | ||
@@ -114,3 +114,3 @@ | ||
if (!isObj(object)) { | ||
return; | ||
return false; | ||
} | ||
@@ -117,0 +117,0 @@ } |
{ | ||
"name": "dot-prop", | ||
"version": "5.2.0", | ||
"version": "5.3.0", | ||
"description": "Get, set, or delete a property from a nested object using a dot path", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -74,2 +74,4 @@ # dot-prop [![Build Status](https://travis-ci.org/sindresorhus/dot-prop.svg?branch=master)](https://travis-ci.org/sindresorhus/dot-prop) | ||
Returns a boolean of whether the property existed before being deleted. | ||
#### object | ||
@@ -76,0 +78,0 @@ |
9607
192
118