Skip to content

Commit

Permalink
fix error: Cannot use 'in' operator to search for 'property' in 'value'
Browse files Browse the repository at this point in the history
  • Loading branch information
epoberezkin committed Feb 17, 2016
1 parent c30e2f6 commit 645e7da
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ api.get = function get (obj, pointer) {
refTokens = api.parse(pointer);
while (refTokens.length) {
tok = refTokens.shift();
if (!(tok in obj)) {
if (!(typeof obj == 'object' && tok in obj)) {
throw new Error('Invalid reference token: ' + tok);
}
obj = obj[tok];
Expand Down

0 comments on commit 645e7da

Please sign in to comment.