Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Object.keys() types refinement, and Object.entries() types bugfix #12253

Closed
wants to merge 4 commits into from

Commits on Nov 15, 2016

  1. Object.entries() types: fixup

    1. Special case array. Because array instances are typed as
    implementing an interface that lists all their public methods, `keyof
    Array` returns all those method names as keys…even though they’re not
    actually enumerable at runtime.
    
    2. Intersect keyof T with string, because `keyof T` can return `number
    | string` in some cases, whereas the entries’ keys will always be
    strings.
    ethanresnick committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    5599d05 View commit details
    Browse the repository at this point in the history
  2. Object.keys: more precise types

    Applying the same logic used on Object.entries in the prior commit and
    in microsoft#12207
    ethanresnick committed Nov 15, 2016
    Configuration menu
    Copy the full SHA
    cda0c4a View commit details
    Browse the repository at this point in the history

Commits on Nov 27, 2016

  1. Configuration menu
    Copy the full SHA
    944625a View commit details
    Browse the repository at this point in the history
  2. Object.keys/entries: remove keyof & string intersections

    Now that keyof T only returns string or string subtypes (microsoft#12425),
    there’s no need to do keyof T & string.
    ethanresnick committed Nov 27, 2016
    Configuration menu
    Copy the full SHA
    29105a6 View commit details
    Browse the repository at this point in the history