{"action":"created","issue":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/8765","repository_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped","labels_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/8765/labels{/name}","comments_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/8765/comments","events_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/8765/events","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/8765","id":144405423,"number":8765,"title":"Make moment's typings for parsing stricter and also allow them to accept union types.","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":"closed","locked":false,"assignee":null,"milestone":null,"comments":3,"created_at":"2016-03-29T22:16:31Z","updated_at":"2016-03-30T04:01:48Z","closed_at":"2016-03-30T04:01:32Z","pull_request":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/pulls/8765","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/8765","diff_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/8765.diff","patch_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/8765.patch"},"body":"These changes do two things.\r\n\r\n1. Replace very lax typings like `any[]` with stricter, more-correct versions. In particular,\r\nthe ISO_8601 constant, while /technically/ a void function, is actually an opaque sentinel\r\nthat a consumer should not know anything about it. The function type was replaced with a\r\nsentinel type using the principle of \"brands\" that can be seen in the Typescript compiler:\r\nhttps://github.com/Microsoft/TypeScript/blob/413d9a639f933df7539070b236c1677de8302a93/src/compiler/types.ts#L9\r\n\r\n2. Replace the many overloads of the parsing methods with a smaller representative set that\r\nuses union types instead. Aside from succinctness, this allows callers to provide a union\r\ntype as the argument, as long as it matches, which was not possible before (Typescript does\r\nnot explode the union type to see if overloads cover all the possibilities)."},"comment":{"url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/comments/203236141","html_url":"https://github.com/DefinitelyTyped/DefinitelyTyped/pull/8765#issuecomment-203236141","issue_url":"https://api.github.com/repos/DefinitelyTyped/DefinitelyTyped/issues/8765","id":203236141,"user":{"login":"horiuchi","id":32570,"avatar_url":"https://avatars.githubusercontent.com/u/32570?v=3","gravatar_id":"","url":"https://api.github.com/users/horiuchi","html_url":"https://github.com/horiuchi","followers_url":"https://api.github.com/users/horiuchi/followers","following_url":"https://api.github.com/users/horiuchi/following{/other_user}","gists_url":"https://api.github.com/users/horiuchi/gists{/gist_id}","starred_url":"https://api.github.com/users/horiuchi/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/horiuchi/subscriptions","organizations_url":"https://api.github.com/users/horiuchi/orgs","repos_url":"https://api.github.com/users/horiuchi/repos","events_url":"https://api.github.com/users/horiuchi/events{/privacy}","received_events_url":"https://api.github.com/users/horiuchi/received_events","type":"User","site_admin":false},"created_at":"2016-03-30T04:01:48Z","updated_at":"2016-03-30T04:01:48Z","body":"@seansfkelley Thanks mate!\r\n@adidahiya Thanks for review!"}}