{"action":"created","issue":{"url":"https://api.github.com/repos/lodash/lodash/issues/2262","repository_url":"https://api.github.com/repos/lodash/lodash","labels_url":"https://api.github.com/repos/lodash/lodash/issues/2262/labels{/name}","comments_url":"https://api.github.com/repos/lodash/lodash/issues/2262/comments","events_url":"https://api.github.com/repos/lodash/lodash/issues/2262/events","html_url":"https://github.com/lodash/lodash/issues/2262","id":149141046,"node_id":"MDU6SXNzdWUxNDkxNDEwNDY=","number":2262,"title":"_.conforms: no way to express some key may be missing","user":{"login":"jrencz","id":948356,"node_id":"MDQ6VXNlcjk0ODM1Ng==","avatar_url":"https://avatars2.githubusercontent.com/u/948356?v=4","gravatar_id":"","url":"https://api.github.com/users/jrencz","html_url":"https://github.com/jrencz","followers_url":"https://api.github.com/users/jrencz/followers","following_url":"https://api.github.com/users/jrencz/following{/other_user}","gists_url":"https://api.github.com/users/jrencz/gists{/gist_id}","starred_url":"https://api.github.com/users/jrencz/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jrencz/subscriptions","organizations_url":"https://api.github.com/users/jrencz/orgs","repos_url":"https://api.github.com/users/jrencz/repos","events_url":"https://api.github.com/users/jrencz/events{/privacy}","received_events_url":"https://api.github.com/users/jrencz/received_events","type":"User","site_admin":false},"labels":[{"id":2763156,"node_id":"MDU6TGFiZWwyNzYzMTU2","url":"https://api.github.com/repos/lodash/lodash/labels/question","name":"question","color":"d4c5f9","default":true}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":3,"created_at":"2016-04-18T12:47:29Z","updated_at":"2018-09-05T08:33:01Z","closed_at":"2016-04-18T15:21:25Z","author_association":"NONE","body":"When I want to express that object:\n- contains of 2 keys `keyA` and `keyA`\n- `keyA` may be missing, but if is defined it's an integer\n- `keyB` is an array of integers\n\nI try:\n\n``` js\nconst isValid = _.conforms({\n  keyA: _.overSome(_.isInteger, _.isUndefined),\n  keyB: _.overEvery(_.isArray,  _.partial(_.every, _, _.isInteger)),\n});\n```\n\n```\nisValid({keyA: 1, keyB: [1,2]});\n// true\n\nisValid({keyB: [1,2]});\n// false\n```\n\nSo far I found no way to express that `keyA` may be missing (I assumed passing `_.isUndefined`) either in `_.over*` or passed as a sole requirement will do the job.\n\nI'm not certain whether `_.conforms` is not the right tool for the job or is it missing some feature?\n"},"comment":{"url":"https://api.github.com/repos/lodash/lodash/issues/comments/418646334","html_url":"https://github.com/lodash/lodash/issues/2262#issuecomment-418646334","issue_url":"https://api.github.com/repos/lodash/lodash/issues/2262","id":418646334,"node_id":"MDEyOklzc3VlQ29tbWVudDQxODY0NjMzNA==","user":{"login":"StreetStrider","id":2124761,"node_id":"MDQ6VXNlcjIxMjQ3NjE=","avatar_url":"https://avatars3.githubusercontent.com/u/2124761?v=4","gravatar_id":"","url":"https://api.github.com/users/StreetStrider","html_url":"https://github.com/StreetStrider","followers_url":"https://api.github.com/users/StreetStrider/followers","following_url":"https://api.github.com/users/StreetStrider/following{/other_user}","gists_url":"https://api.github.com/users/StreetStrider/gists{/gist_id}","starred_url":"https://api.github.com/users/StreetStrider/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/StreetStrider/subscriptions","organizations_url":"https://api.github.com/users/StreetStrider/orgs","repos_url":"https://api.github.com/users/StreetStrider/repos","events_url":"https://api.github.com/users/StreetStrider/events{/privacy}","received_events_url":"https://api.github.com/users/StreetStrider/received_events","type":"User","site_admin":false},"created_at":"2018-09-05T08:33:01Z","updated_at":"2018-09-05T08:33:01Z","author_association":"CONTRIBUTOR","body":"There's a bunch of nice (but majority of are abandoned) projects for such tasks, like `tcomb`, `sanctuary-def`, `shapely`, `runtypes`."}}
{"actor":{"display_login":"StreetStrider"}}