Skip to content

Commit

Permalink
updating libs and fixing lint errors
Browse files Browse the repository at this point in the history
  • Loading branch information
skratchdot committed Jul 26, 2020
1 parent ea9428a commit 0bdbebd
Show file tree
Hide file tree
Showing 6 changed files with 5,042 additions and 4,065 deletions.
65 changes: 29 additions & 36 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,48 +1,41 @@
<a name="Unreleased"></a>

## Unreleased (2018-02-25)

* add prettier and `npm run build` ([ef101c1](https://github.com/skratchdot/object-path-get/commit/ef101c1))
* adding `npm run watch` ([9948c22](https://github.com/skratchdot/object-path-get/commit/9948c22))
* adding contributors ([9e8304a](https://github.com/skratchdot/object-path-get/commit/9e8304a))
* only run travis on node versions >= 4.0 ([e5cf3b6](https://github.com/skratchdot/object-path-get/commit/e5cf3b6))
* rename tonic to runkit ([6382a24](https://github.com/skratchdot/object-path-get/commit/6382a24))
* small readme tweaks ([23bf6da](https://github.com/skratchdot/object-path-get/commit/23bf6da))
* small tweak to runkit script ([1bc0111](https://github.com/skratchdot/object-path-get/commit/1bc0111))
* travis runs node 6+ ([7a928b8](https://github.com/skratchdot/object-path-get/commit/7a928b8))
* update travis config ([e2e8369](https://github.com/skratchdot/object-path-get/commit/e2e8369))
* updating changelog and changelog generator ([587c9b6](https://github.com/skratchdot/object-path-get/commit/587c9b6))
* updating libs and moving to jest ([a64e222](https://github.com/skratchdot/object-path-get/commit/a64e222))
* use prettier on markdown files ([626112f](https://github.com/skratchdot/object-path-get/commit/626112f))

<a name="1.0.0"></a>
## Unreleased (2020-07-26)

## <small>1.0.1 (2020-07-26)</small>

- add prettier and `npm run build` ([ef101c1](https://github.com/skratchdot/object-path-get/commit/ef101c1))
- adding `npm run watch` ([9948c22](https://github.com/skratchdot/object-path-get/commit/9948c22))
- adding contributors ([9e8304a](https://github.com/skratchdot/object-path-get/commit/9e8304a))
- only run travis on node versions >= 4.0 ([e5cf3b6](https://github.com/skratchdot/object-path-get/commit/e5cf3b6))
- rename tonic to runkit ([6382a24](https://github.com/skratchdot/object-path-get/commit/6382a24))
- small readme tweaks ([ea9428a](https://github.com/skratchdot/object-path-get/commit/ea9428a))
- small tweak to runkit script ([1bc0111](https://github.com/skratchdot/object-path-get/commit/1bc0111))
- travis runs node 6+ ([7a928b8](https://github.com/skratchdot/object-path-get/commit/7a928b8))
- update travis config ([e2e8369](https://github.com/skratchdot/object-path-get/commit/e2e8369))
- updating changelog and changelog generator ([587c9b6](https://github.com/skratchdot/object-path-get/commit/587c9b6))
- updating libs and fixing lint errors ([e0e02aa](https://github.com/skratchdot/object-path-get/commit/e0e02aa))
- updating libs and moving to jest ([a64e222](https://github.com/skratchdot/object-path-get/commit/a64e222))
- use prettier on markdown files ([626112f](https://github.com/skratchdot/object-path-get/commit/626112f))

## 1.0.0 (2016-08-27)

* Add support for array paths ([8631b98](https://github.com/skratchdot/object-path-get/commit/8631b98))
* adding a few more tests ([6607e8e](https://github.com/skratchdot/object-path-get/commit/6607e8e))
* adding changelog and bumping version ([d7299ee](https://github.com/skratchdot/object-path-get/commit/d7299ee))
* removing gulp in favor of npm-scripts ([3b380e0](https://github.com/skratchdot/object-path-get/commit/3b380e0))
* small coding style tweak ([5b3eff9](https://github.com/skratchdot/object-path-get/commit/5b3eff9))

<a name="0.0.3"></a>
- Add support for array paths ([8631b98](https://github.com/skratchdot/object-path-get/commit/8631b98))
- adding a few more tests ([6607e8e](https://github.com/skratchdot/object-path-get/commit/6607e8e))
- adding changelog and bumping version ([d7299ee](https://github.com/skratchdot/object-path-get/commit/d7299ee))
- removing gulp in favor of npm-scripts ([3b380e0](https://github.com/skratchdot/object-path-get/commit/3b380e0))
- small coding style tweak ([5b3eff9](https://github.com/skratchdot/object-path-get/commit/5b3eff9))

## <small>0.0.3 (2015-11-20)</small>

* adding mocha and istanbul for test coverage ([8a23164](https://github.com/skratchdot/object-path-get/commit/8a23164))
* adding tonic example to README.md ([7ef679c](https://github.com/skratchdot/object-path-get/commit/7ef679c))
* fixing coveralls badge ([a5b8a4a](https://github.com/skratchdot/object-path-get/commit/a5b8a4a))
* fixing travis build and coveralls support ([ad8f26a](https://github.com/skratchdot/object-path-get/commit/ad8f26a))
* removing unused .jshintrc ([eb7efc3](https://github.com/skratchdot/object-path-get/commit/eb7efc3))

<a name="0.0.2"></a>
- adding mocha and istanbul for test coverage ([8a23164](https://github.com/skratchdot/object-path-get/commit/8a23164))
- adding tonic example to README.md ([7ef679c](https://github.com/skratchdot/object-path-get/commit/7ef679c))
- fixing coveralls badge ([a5b8a4a](https://github.com/skratchdot/object-path-get/commit/a5b8a4a))
- fixing travis build and coveralls support ([ad8f26a](https://github.com/skratchdot/object-path-get/commit/ad8f26a))
- removing unused .jshintrc ([eb7efc3](https://github.com/skratchdot/object-path-get/commit/eb7efc3))

## <small>0.0.2 (2014-09-16)</small>

* allow inherited properties to be found. ([693e9cf](https://github.com/skratchdot/object-path-get/commit/693e9cf))

<a name="0.0.1"></a>
- allow inherited properties to be found. ([693e9cf](https://github.com/skratchdot/object-path-get/commit/693e9cf))

## <small>0.0.1 (2014-09-15)</small>

* initial commit ([4c73882](https://github.com/skratchdot/object-path-get/commit/4c73882))
- initial commit ([4c73882](https://github.com/skratchdot/object-path-get/commit/4c73882))
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,9 +37,9 @@ getPath(obj, ['foo', 'bar']); // result "baz" (with array path)

## Links

* [Source Code](https://github.com/skratchdot/object-path-get)
* [Changelog](https://github.com/skratchdot/object-path-get/blob/master/CHANGELOG.md)
* [Live example on Runkit](https://npm.runkit.com/object-path-get)
- [Source Code](https://github.com/skratchdot/object-path-get)
- [Changelog](https://github.com/skratchdot/object-path-get/blob/master/CHANGELOG.md)
- [Live example on Runkit](https://npm.runkit.com/object-path-get)

## Contributors

Expand Down
7 changes: 5 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,16 @@
'use strict';

module.exports = exports = function(obj, path, defaultValue, delimiter) {
module.exports = exports = function (obj, path, defaultValue, delimiter) {
if (typeof path === 'string') {
path = path.split(delimiter || '.');
}
if (Array.isArray(path)) {
var len = path.length;
for (var i = 0; i < len; i++) {
if (obj && (obj.hasOwnProperty(path[i]) || obj[path[i]])) {
if (
obj &&
(Object.prototype.hasOwnProperty.call(obj, path[i]) || obj[path[i]])
) {
obj = obj[path[i]];
} else {
return defaultValue;
Expand Down
Loading

0 comments on commit 0bdbebd

Please sign in to comment.