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(pick): accept a callback for advanced picking #30

Merged
merged 4 commits into from
Jul 7, 2024

Conversation

aleclarson
Copy link
Member

@aleclarson aleclarson commented Jun 26, 2024

Tip

The owner of this PR can publish a preview release by commenting /publish in this PR. Afterwards, anyone can try it out by running pnpm add radashi@pr<PR_NUMBER>.

Description

const newObject = pick(object, (value, key, object) => key.startsWith('a'))

This brings lodash.pickBy functionality to Radashi.

Checklist

  • PR feat: add reduceKeys function #29 is merged
  • Changes are covered by tests if behavior has been changed or added
  • Tests have 100% coverage
  • If code changes were made, the documentation (in the /docs directory) has been updated

Resolves

sodiray/radash#157
sodiray/radash#402

Also fixes sodiray/radash#326, because the array of keys can now be typed readonly without complaints from TypeScript.

@aleclarson aleclarson added the new feature This PR adds a new function or extends an existing one label Jun 28, 2024
@aleclarson aleclarson force-pushed the main branch 4 times, most recently from 35fc67a to 04bad7b Compare July 1, 2024 19:17
@aleclarson aleclarson marked this pull request as draft July 3, 2024 18:08
@aleclarson aleclarson force-pushed the feat/pick-callback branch 3 times, most recently from 3cf85dd to ed2aa86 Compare July 7, 2024 23:12
@aleclarson aleclarson force-pushed the feat/pick-callback branch from ed2aa86 to b6e11ec Compare July 7, 2024 23:32
@aleclarson aleclarson marked this pull request as ready for review July 7, 2024 23:32
@aleclarson aleclarson merged commit b9dc648 into main Jul 7, 2024
4 checks passed
@aleclarson aleclarson deleted the feat/pick-callback branch July 7, 2024 23:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
new feature This PR adds a new function or extends an existing one
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Feature request - pick with readonly array
1 participant