Skip to content

Commit

Permalink
Remove logic for unreachable condition
Browse files Browse the repository at this point in the history
  • Loading branch information
mrodrig committed May 25, 2021
1 parent 8ee7426 commit b7f0beb
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 9 deletions.
2 changes: 1 addition & 1 deletion dist/path.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 0 additions & 7 deletions lib/path.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,6 @@ function setPath(obj, kp, v) {
return _sp(obj, kp, v);
}

function isObject(v) {
return typeof v === 'object' && v !== null;
}

/**
* Helper function that will set the value in the provided object/array.
* @param obj {Object|Array} object to set value in
Expand All @@ -85,9 +81,6 @@ function _sp(obj, kp, v) {
} else if (!obj[key]) {
// If the current key doesn't exist yet, populate it
obj[key] = {};
} else if (!isObject(obj[key])) {
obj[kp] = v;
return obj;
}
_sp(obj[key], remaining, v);
} else if (Array.isArray(obj)) {
Expand Down
2 changes: 1 addition & 1 deletion test/tests.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

/* eslint no-unused-vars: ["error", { "varsIgnorePattern": "should" }]*/

let path = require('../dist/path'),
let path = require('../lib/path'),
should = require('should'),
assert = require('assert'),
doc = {};
Expand Down

0 comments on commit b7f0beb

Please sign in to comment.