{"action":"created","issue":{"url":"https://api.github.com/repos/mirek/node-json-criteria/issues/6","repository_url":"https://api.github.com/repos/mirek/node-json-criteria","labels_url":"https://api.github.com/repos/mirek/node-json-criteria/issues/6/labels{/name}","comments_url":"https://api.github.com/repos/mirek/node-json-criteria/issues/6/comments","events_url":"https://api.github.com/repos/mirek/node-json-criteria/issues/6/events","html_url":"https://github.com/mirek/node-json-criteria/issues/6","id":346788116,"node_id":"MDU6SXNzdWUzNDY3ODgxMTY=","number":6,"title":"Filters with sub-criteria for non-existent parameters crash test function","user":{"login":"kav","id":216737,"node_id":"MDQ6VXNlcjIxNjczNw==","avatar_url":"https://avatars2.githubusercontent.com/u/216737?v=4","gravatar_id":"","url":"https://api.github.com/users/kav","html_url":"https://github.com/kav","followers_url":"https://api.github.com/users/kav/followers","following_url":"https://api.github.com/users/kav/following{/other_user}","gists_url":"https://api.github.com/users/kav/gists{/gist_id}","starred_url":"https://api.github.com/users/kav/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kav/subscriptions","organizations_url":"https://api.github.com/users/kav/orgs","repos_url":"https://api.github.com/users/kav/repos","events_url":"https://api.github.com/users/kav/events{/privacy}","received_events_url":"https://api.github.com/users/kav/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":1,"created_at":"2018-08-01T22:09:31Z","updated_at":"2018-08-01T22:19:23Z","closed_at":null,"author_association":"NONE","body":"Perhaps I'm holding it wrong, but I'm seeing an error if my filter has nesting that isn't present in the object under filter. I can preprocess to ensure keys match if this is the expected behavior but that seems a bit messy.\r\n\r\n```javascript\r\nimport 'babel-polyfill';\r\nimport { test } from 'json-criteria';\r\n\r\nconsole.log(test({ bar: 1 }, { foo: { baz: 1, bar: '1' } }))\r\n```\r\n\r\nExpected:\r\n```console\r\nfalse\r\n```\r\n\r\nActual:\r\n```\r\n./node_modules/json-criteria/lib/engine.js:149\r\n                r = r && this.test(dvp[dk[0]], qv);\r\n                                      ^\r\n\r\nTypeError: Cannot read property 'baz' of undefined\r\n    at Engine.test (/Users/kav/Projects/_OS/test/node_modules/json-criteria/lib/src/engine.js:81:35)\r\n    at Engine.test (/Users/kav/Projects/_OS/test/node_modules/json-criteria/lib/src/engine.js:81:27)\r\n    at test (/Users/kav/Projects/_OS/test/node_modules/json-criteria/lib/src/index.js:8:17)\r\n    at Object.<anonymous> (/Users/kav/Projects/_OS/test/index.js:4:13)\r\n    at Module._compile (internal/modules/cjs/loader.js:689:30)\r\n    at loader (/Users/kav/Projects/_OS/test/node_modules/babel-register/lib/node.js:144:5)\r\n    at Object.require.extensions.(anonymous function) [as .js] (/Users/kav/Projects/_OS/test/node_modules/babel-register/lib/node.js:154:7)\r\n    at Module.load (internal/modules/cjs/loader.js:599:32)\r\n    at tryModuleLoad (internal/modules/cjs/loader.js:538:12)\r\n    at Function.Module._load (internal/modules/cjs/loader.js:530:3)\r\n```"},"comment":{"url":"https://api.github.com/repos/mirek/node-json-criteria/issues/comments/409743599","html_url":"https://github.com/mirek/node-json-criteria/issues/6#issuecomment-409743599","issue_url":"https://api.github.com/repos/mirek/node-json-criteria/issues/6","id":409743599,"node_id":"MDEyOklzc3VlQ29tbWVudDQwOTc0MzU5OQ==","user":{"login":"mirek","id":8561,"node_id":"MDQ6VXNlcjg1NjE=","avatar_url":"https://avatars2.githubusercontent.com/u/8561?v=4","gravatar_id":"","url":"https://api.github.com/users/mirek","html_url":"https://github.com/mirek","followers_url":"https://api.github.com/users/mirek/followers","following_url":"https://api.github.com/users/mirek/following{/other_user}","gists_url":"https://api.github.com/users/mirek/gists{/gist_id}","starred_url":"https://api.github.com/users/mirek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mirek/subscriptions","organizations_url":"https://api.github.com/users/mirek/orgs","repos_url":"https://api.github.com/users/mirek/repos","events_url":"https://api.github.com/users/mirek/events{/privacy}","received_events_url":"https://api.github.com/users/mirek/received_events","type":"User","site_admin":false},"created_at":"2018-08-01T22:19:23Z","updated_at":"2018-08-01T22:19:23Z","author_association":"OWNER","body":"Yes, that doesn't look right, can you check if that commit fixes it (sorry, commit message closed this issue)."}}
{"actor":{"display_login":"mirek"}}