Skip to content

Commit

Permalink
support non-standard js objects, closes #152
Browse files Browse the repository at this point in the history
  • Loading branch information
nlf committed Nov 14, 2015
1 parent 39cf506 commit 88a6731
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/index.js
Expand Up @@ -608,7 +608,7 @@ exports.reach = function (obj, chain, options) {
}

if (!ref ||
!ref.hasOwnProperty(key) ||
!((typeof ref === 'object' || typeof ref === 'function') && key in ref) ||
(typeof ref !== 'object' && options.functions === false)) { // Only object and function can have properties

exports.assert(!options.strict || i + 1 === path.length, 'Missing segment', key, 'in reach path ', chain);
Expand Down

1 comment on commit 88a6731

@MathieuLoutre
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing! Thank you!

Please sign in to comment.