{"action":"created","issue":{"url":"https://api.github.com/repos/crcn/sift.js/issues/66","labels_url":"https://api.github.com/repos/crcn/sift.js/issues/66/labels{/name}","comments_url":"https://api.github.com/repos/crcn/sift.js/issues/66/comments","events_url":"https://api.github.com/repos/crcn/sift.js/issues/66/events","html_url":"https://github.com/crcn/sift.js/pull/66","id":93894718,"number":66,"title":"Add an isObject function and use it.","user":{"login":"jloveridge","id":393606,"avatar_url":"https://avatars.githubusercontent.com/u/393606?v=3","gravatar_id":"","url":"https://api.github.com/users/jloveridge","html_url":"https://github.com/jloveridge","followers_url":"https://api.github.com/users/jloveridge/followers","following_url":"https://api.github.com/users/jloveridge/following{/other_user}","gists_url":"https://api.github.com/users/jloveridge/gists{/gist_id}","starred_url":"https://api.github.com/users/jloveridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jloveridge/subscriptions","organizations_url":"https://api.github.com/users/jloveridge/orgs","repos_url":"https://api.github.com/users/jloveridge/repos","events_url":"https://api.github.com/users/jloveridge/events{/privacy}","received_events_url":"https://api.github.com/users/jloveridge/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2015-07-08T21:30:54Z","updated_at":"2015-07-09T00:36:05Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/crcn/sift.js/pulls/66","html_url":"https://github.com/crcn/sift.js/pull/66","diff_url":"https://github.com/crcn/sift.js/pull/66.diff","patch_url":"https://github.com/crcn/sift.js/pull/66.patch"},"body":"I attempted to use sift in a project where we use a customized REPL and encountered an issue where things didn't filter properly. All of the examples were returning an empty array instead of the expected values. The problem turned out to be the way the statement was being checked to see if it was an Object. I snagged the `isObject` code from `lodash` and used that for the check instead and the issue goes away. The issue can be observed for yourself by creating any custom REPL environment. The following would do:\r\n\r\n```javascript\r\nrequire('repl').start({prompt: 'custom> '})\r\n```\r\n\r\nThen using it:\r\n```\r\n$ node custom-repl.js\r\ncustom> var sift = require('sift');\r\nundefined\r\ncustom> sift({ $in: ['hello','world'] }, ['hello','sifted','array!']);\r\n[]\r\ncustom> \r\n```"},"comment":{"url":"https://api.github.com/repos/crcn/sift.js/issues/comments/119770710","html_url":"https://github.com/crcn/sift.js/pull/66#issuecomment-119770710","issue_url":"https://api.github.com/repos/crcn/sift.js/issues/66","id":119770710,"user":{"login":"jloveridge","id":393606,"avatar_url":"https://avatars.githubusercontent.com/u/393606?v=3","gravatar_id":"","url":"https://api.github.com/users/jloveridge","html_url":"https://github.com/jloveridge","followers_url":"https://api.github.com/users/jloveridge/followers","following_url":"https://api.github.com/users/jloveridge/following{/other_user}","gists_url":"https://api.github.com/users/jloveridge/gists{/gist_id}","starred_url":"https://api.github.com/users/jloveridge/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jloveridge/subscriptions","organizations_url":"https://api.github.com/users/jloveridge/orgs","repos_url":"https://api.github.com/users/jloveridge/repos","events_url":"https://api.github.com/users/jloveridge/events{/privacy}","received_events_url":"https://api.github.com/users/jloveridge/received_events","type":"User","site_admin":false},"created_at":"2015-07-09T00:36:05Z","updated_at":"2015-07-09T00:36:05Z","body":"With my original change it was causing a bunch of failures in the tests due to arrays, dates, and the ObjectID failing to use the `eq` test. Resolving the issue for dates and arrays was simple enough but custom objects proved more problematic. The `ObjectID` tests failed inside of the `toHexString` as `this` wasn't an `ObjectID` but rather `{test: function...}`. (I still don't know how it ended up calling that function.)\r\n\r\nI have tested the latest both inside the standard node shell and within a custom REPL and everything now seems to work."}}