We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
2 parents 923d58d + c280ba3 commit 7bd5011Copy full SHA for 7bd5011
index.js
@@ -100,10 +100,8 @@ function createKey(pattern, options) {
100
101
function isObject(val) {
102
switch (typeof val) {
103
- case 'null':
104
- return false;
105
case 'object':
106
- return true;
+ return val !== null;
107
case 'function':
108
return true;
109
default: {
test.js
@@ -14,8 +14,10 @@ const set = require('./');
14
15
describe('set', function() {
16
it('should return non-objects', function() {
17
- const res = set('foo', 'a.b', 'c');
+ var res = set('foo', 'a.b', 'c');
18
assert.equal(res, 'foo');
19
+ res = set(null, 'a.b', 'c');
20
+ assert.equal(res, null);
21
});
22
23
it('should create a nested property if it does not already exist', function() {
0 commit comments