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

feat: KnownKeys<T> #52

Merged
merged 2 commits into from
Feb 14, 2020
Merged

feat: KnownKeys<T> #52

merged 2 commits into from
Feb 14, 2020

Conversation

unional
Copy link
Owner

@unional unional commented Jan 6, 2020

Originally by @ajafff and learn from @Gerrit0

Is it ok to you about sharing KnownKeys<T> in this library?

I mentioned your names in https://github.com/unional/type-plus/compare/known-keys?expand=1#diff-3fd41558ce97781e45aa28e9885e9c2e

Reference:
microsoft/TypeScript#25987 (comment)

Best,
Uni

@codecov-io
Copy link

codecov-io commented Jan 6, 2020

Codecov Report

Merging #52 into master will not change coverage.
The diff coverage is n/a.

Impacted file tree graph

@@           Coverage Diff           @@
##           master      #52   +/-   ##
=======================================
  Coverage   98.07%   98.07%           
=======================================
  Files          23       23           
  Lines         104      104           
  Branches        5        5           
=======================================
  Hits          102      102           
  Misses          2        2
Impacted Files Coverage Δ
src/index.ts 100% <ø> (ø) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 7ab0b25...376f36f. Read the comment docs.

@Gerrit0
Copy link

Gerrit0 commented Jan 6, 2020

No credit due to me, I just did a google search and shared something I found that was neat :)

@Gerrit0
Copy link

Gerrit0 commented Jan 6, 2020

You should probably include the bugfixed version from lower down in the thread though, I hadn't seen it yet. microsoft/TypeScript#25987 (comment)

type KnownKeys<T> = {
    [K in keyof T]: string extends K ? never : number extends K ? never : K
} extends {[_ in keyof T]: infer U} ? ({} extends U ? never : U) : never;

@unional
Copy link
Owner Author

unional commented Jan 6, 2020

@Gerrit0 thanks! Updated and added tests. :)

@unional unional merged commit d22abda into master Feb 14, 2020
@unional unional deleted the known-keys branch February 14, 2020 09:36
@unional
Copy link
Owner Author

unional commented Feb 14, 2020

🎉 This PR is included in version 1.32.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants