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

New API Proposal for extending Pick/Omit and Object-Keys Helpers #59

Closed
piotrwitek opened this issue Jan 16, 2019 · 2 comments · Fixed by #79
Closed

New API Proposal for extending Pick/Omit and Object-Keys Helpers #59

piotrwitek opened this issue Jan 16, 2019 · 2 comments · Fixed by #79

Comments

@piotrwitek
Copy link
Owner

piotrwitek commented Jan 16, 2019

I agree we could greatly benefit from both general helpers and shortcuts.

New API Proposal for extending Pick/Omit and Object-Keys Helpers

General:

we need to have consistent convention between Keys and Pick helpers and have variations for matching by assignability and exact type

  • PickByValue<TObj, TValue>

  • PickByExactValue<TObj, TValue>

  • OmitByValue<TObj, TValue>

  • OmitByExactValue<TObj, TValue>

  • KeysByValue<TObj, TValue> === keyof PickByValue<TObj, TValue> - no need to implement

  • KeysByExactValue<TObj, TValue> === keyof PickByExactValue<TObj, TValue> - no need to implement

Shortcuts:

Existing:

  • FunctionKeys
  • NonFunctionKeys
  • ReadonlyKeys
  • WritableKeys

New:

Open for feedback/improvements!

@IssueHuntBot
Copy link

@IssueHunt has funded $50.00 to this issue.


@piotrwitek piotrwitek changed the title New API Proposal for extending Pick/Omit and Object-Keys Helpers General New API Proposal for extending Pick/Omit and Object-Keys Helpers Apr 28, 2019
piotrwitek added a commit that referenced this issue Apr 28, 2019
- Added RequiredKeys and OptionalKeys #53
- Added OmitByValue and PickByValue to the public API #50 
- Added OmitByValueExact and PickByValueExact #59
@IssueHuntBot
Copy link

@piotrwitek has rewarded $35.00 to @piotrwitek. See it on IssueHunt

  • 💰 Total deposit: $50.00
  • 🎉 Repository reward(20%): $10.00
  • 🔧 Service fee(10%): $5.00

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

Successfully merging a pull request may close this issue.

2 participants