Comparing version 0.2.0 to 0.2.1
@@ -13,8 +13,5 @@ /*! | ||
module.exports = function getValue(o, prop) { | ||
if (o == null) { | ||
if (o == null || !isObject(o)) { | ||
return {}; | ||
} | ||
if (o && !isObject(o)) { | ||
return {}; | ||
} | ||
if (prop == null) { | ||
@@ -32,3 +29,3 @@ return o; | ||
if (o == null) { | ||
return null; | ||
return {}; | ||
} | ||
@@ -35,0 +32,0 @@ } |
{ | ||
"name": "get-value", | ||
"description": "Use property paths (`a.b.c`) get a nested value from an object.", | ||
"version": "0.2.0", | ||
"version": "0.2.1", | ||
"homepage": "https://github.com/jonschlinkert/get-value", | ||
@@ -6,0 +6,0 @@ "author": { |
@@ -24,6 +24,6 @@ /*! | ||
it('should return null if the path is not found', function () { | ||
it('should return an empty object if the path is not found', function () { | ||
var fixture = {}; | ||
(get(fixture, 'a.locals.name') == null).should.be.true; | ||
(get(fixture, 'b.locals.name') == null).should.be.true; | ||
get(fixture, 'a.locals.name').should.eql({}); | ||
get(fixture, 'b.locals.name').should.eql({}); | ||
}); | ||
@@ -30,0 +30,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
7612
71