{"action":"created","issue":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/9388","repository_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped","labels_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/9388/labels{/name}","comments_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/9388/comments","events_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/9388/events","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/9388","id":155624107,"number":9388,"title":"Inferrable _.assign*, _.extend*, _.defaults","user":{"login":"seansfkelley","id":2101409,"avatar_url":"https://avatars.githubusercontent.com/u/2101409?v=3","gravatar_id":"","url":"https://api.github.com/users/seansfkelley","html_url":"https://github.com/seansfkelley","followers_url":"https://api.github.com/users/seansfkelley/followers","following_url":"https://api.github.com/users/seansfkelley/following{/other_user}","gists_url":"https://api.github.com/users/seansfkelley/gists{/gist_id}","starred_url":"https://api.github.com/users/seansfkelley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seansfkelley/subscriptions","organizations_url":"https://api.github.com/users/seansfkelley/orgs","repos_url":"https://api.github.com/users/seansfkelley/repos","events_url":"https://api.github.com/users/seansfkelley/events{/privacy}","received_events_url":"https://api.github.com/users/seansfkelley/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":2,"created_at":"2016-05-18T23:28:51Z","updated_at":"2016-05-18T23:36:22Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/9388","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/9388","diff_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/9388.diff","patch_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/9388.patch"},"body":"Following the pattern that 4e4ffc7e used for `_.merge`, redefine `_.assign*`, `_.extend*` and `_.defaults` to use intersection types. This means that almost all normal usages are able to infer much more informative types than just `{}`.\r\n\r\nA few random notes about these changes: \r\n\r\n- Split tests for `_.extend` into a suite just for `_.extendWith`.\r\n- I wasn't able to find a clever method for aliasing `extend` as `assignIn` without just copy-pasting it it (I tried playing around with `typeof`, etc).\r\n- `_.defaults`'s return types' ordering is backwards from that in the parameter list because it appears that Typescript uses \"latest wins\" to resolve an intersection of types that define the same field name. Doing it backwards ensures that earlier parameters, which are later in the type expression, take precedence.\r\n- Uncommented the `lodash/extendWith` module export since it exists now."},"comment":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/comments/220189190","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/9388#issuecomment-220189190","issue_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/9388","id":220189190,"user":{"login":"seansfkelley","id":2101409,"avatar_url":"https://avatars.githubusercontent.com/u/2101409?v=3","gravatar_id":"","url":"https://api.github.com/users/seansfkelley","html_url":"https://github.com/seansfkelley","followers_url":"https://api.github.com/users/seansfkelley/followers","following_url":"https://api.github.com/users/seansfkelley/following{/other_user}","gists_url":"https://api.github.com/users/seansfkelley/gists{/gist_id}","starred_url":"https://api.github.com/users/seansfkelley/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/seansfkelley/subscriptions","organizations_url":"https://api.github.com/users/seansfkelley/orgs","repos_url":"https://api.github.com/users/seansfkelley/repos","events_url":"https://api.github.com/users/seansfkelley/events{/privacy}","received_events_url":"https://api.github.com/users/seansfkelley/received_events","type":"User","site_admin":false},"created_at":"2016-05-18T23:36:22Z","updated_at":"2016-05-18T23:36:22Z","body":"Whoops, almost forgot to remove all the type parameterization from the tests! That's the whole point of these changes."}}