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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃挭 Typesafe pick, omit and pluck #1

Merged
merged 8 commits into from Dec 4, 2017

Conversation

nicolasgramlich
Copy link
Contributor

No description provided.

@@ -0,0 +1,8 @@
import * as Lodash from 'lodash';

export type Diff<T extends string, U extends string> = ({[P in T]: P } & {[P in U]: never } & { [x: string]: never })[T];
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

TDiff?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Don't you think it's nicer like this, because it blends in amongst Pick<> and co?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense indeed, could expose those as types BTW?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You mean move them to the types directory?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Done

Copy link
Contributor

@SylvainEstevez SylvainEstevez left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM beside naming convention

@nicolasgramlich
Copy link
Contributor Author

Travis build is broken due to: npm/npm#17858

@nicolasgramlich
Copy link
Contributor Author

Build: 馃崗 after removing node_modules from cache. This repo is so small we'll be fine without caching

@nicolasgramlich nicolasgramlich merged commit 3289c4a into master Dec 4, 2017
@nicolasgramlich nicolasgramlich deleted the feature/typesafe-pick-omit-pluck branch December 4, 2017 22:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants