Comparing version 4.1.1 to 4.2.0
@@ -56,5 +56,6 @@ 'use strict'; | ||
if (!isObj(obj) || typeof path !== 'string') { | ||
return; | ||
return obj; | ||
} | ||
const root = obj; | ||
const pathArr = getPathSegments(path); | ||
@@ -75,2 +76,4 @@ | ||
} | ||
return root; | ||
}, | ||
@@ -77,0 +80,0 @@ |
{ | ||
"name": "dot-prop", | ||
"version": "4.1.1", | ||
"version": "4.2.0", | ||
"description": "Get, set, or delete a property from a nested object using a dot path", | ||
@@ -5,0 +5,0 @@ "license": "MIT", |
@@ -37,2 +37,6 @@ # dot-prop [![Build Status](https://travis-ci.org/sindresorhus/dot-prop.svg?branch=master)](https://travis-ci.org/sindresorhus/dot-prop) | ||
const foo = dotProp.set({}, 'foo.bar', 'c'); | ||
console.log(foo); | ||
//=> {foo: {bar: 'c'}} | ||
dotProp.set(obj, 'foo.baz', 'x'); | ||
@@ -65,2 +69,4 @@ console.log(obj); | ||
Returns the object. | ||
### has(obj, path) | ||
@@ -67,0 +73,0 @@ |
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
5905
93
104