{"action":"created","issue":{"url":"https://api.github.com/repos/jashkenas/underscore/issues/2494","repository_url":"https://api.github.com/repos/jashkenas/underscore","labels_url":"https://api.github.com/repos/jashkenas/underscore/issues/2494/labels{/name}","comments_url":"https://api.github.com/repos/jashkenas/underscore/issues/2494/comments","events_url":"https://api.github.com/repos/jashkenas/underscore/issues/2494/events","html_url":"https://github.com/jashkenas/underscore/pull/2494","id":146686736,"number":2494,"title":"Allow deep property matching via array syntax","user":{"login":"captbaritone","id":162735,"avatar_url":"https://avatars.githubusercontent.com/u/162735?v=3","gravatar_id":"","url":"https://api.github.com/users/captbaritone","html_url":"https://github.com/captbaritone","followers_url":"https://api.github.com/users/captbaritone/followers","following_url":"https://api.github.com/users/captbaritone/following{/other_user}","gists_url":"https://api.github.com/users/captbaritone/gists{/gist_id}","starred_url":"https://api.github.com/users/captbaritone/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/captbaritone/subscriptions","organizations_url":"https://api.github.com/users/captbaritone/orgs","repos_url":"https://api.github.com/users/captbaritone/repos","events_url":"https://api.github.com/users/captbaritone/events{/privacy}","received_events_url":"https://api.github.com/users/captbaritone/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/jashkenas/underscore/labels/enhancement","name":"enhancement","color":"84b6eb"}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":14,"created_at":"2016-04-07T17:09:30Z","updated_at":"2016-10-13T15:47:51Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/jashkenas/underscore/pulls/2494","html_url":"https://github.com/jashkenas/underscore/pull/2494","diff_url":"https://github.com/jashkenas/underscore/pull/2494.diff","patch_url":"https://github.com/jashkenas/underscore/pull/2494.patch"},"body":"Replaces #2486\r\n\r\nInspired by underscore-contrib`'s _.getPath` and lodash's deep property access,\r\nthis adds an Array deep property access shorthand to many aspects of\r\nUnderscore, including:\r\n\r\n* `_.property`\r\n* `_.iteratee` and all methods that depend on it.\r\n* `_.has`\r\n* `_.result` (including deep evaluation)\r\n\r\nPossible Concerns\r\n=================\r\n\r\n`_.property`\r\n------------\r\n\r\nWhile `_.property` does not get called in any place that would present\r\na performance concern, `getLength` (which is created by `_.property`) gets used\r\nin many places which _may_ have performance ramifications.\r\n\r\nI've placed the `isArray` call in the outer function of `_.property` in an\r\nattempt to reduce complexity inside the generated function. This required\r\ndefining `isArray` earlier.\r\n\r\nIt's possible that this still isn't fast enough, and we should just define\r\n`getLength` manually.\r\n\r\n`_.has`\r\n-------\r\n\r\nThis adds some complexity to `_.has` which underpins many methods. It's\r\npossible that we may want to use a simpler \"flat\" version of `_.has`\r\ninternally.\r\n\r\nFurther work\r\n============\r\n\r\nWe may want to expose some additional helper methods:\r\n\r\n* `_.get`\r\n* `_.set`\r\n* `_.unset`\r\n\r\nFixes: #2372, an elegant solution to an oft requested feature: (see: #2370,\r\n #2268, #1169, #1266)"},"comment":{"url":"https://api.github.com/repos/jashkenas/underscore/issues/comments/253554012","html_url":"https://github.com/jashkenas/underscore/pull/2494#issuecomment-253554012","issue_url":"https://api.github.com/repos/jashkenas/underscore/issues/2494","id":253554012,"user":{"login":"jashkenas","id":4732,"avatar_url":"https://avatars.githubusercontent.com/u/4732?v=3","gravatar_id":"","url":"https://api.github.com/users/jashkenas","html_url":"https://github.com/jashkenas","followers_url":"https://api.github.com/users/jashkenas/followers","following_url":"https://api.github.com/users/jashkenas/following{/other_user}","gists_url":"https://api.github.com/users/jashkenas/gists{/gist_id}","starred_url":"https://api.github.com/users/jashkenas/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jashkenas/subscriptions","organizations_url":"https://api.github.com/users/jashkenas/orgs","repos_url":"https://api.github.com/users/jashkenas/repos","events_url":"https://api.github.com/users/jashkenas/events{/privacy}","received_events_url":"https://api.github.com/users/jashkenas/received_events","type":"User","site_admin":false},"created_at":"2016-10-13T15:47:51Z","updated_at":"2016-10-13T15:47:51Z","body":"> Does anyone (@jashkenash ?) believes both of the following?\r\n> \r\n> The array syntax is only worth implementing if we are also planning on implementing the string syntax.\r\n> It is nessesary to see a working implementation of the string syntax before we commit to supporting it.\r\n\r\nI lukewarm believe #1, but I don't believe #2. If we want to go forward with this, this ticket is a fine place to start. LGTM."}}
{"actor":{"display_login":"jashkenas"}}