radash icon indicating copy to clipboard operation
radash copied to clipboard

feat: Add `collect` and `collectFirst` functions

Open adamhamlin opened this issue 1 year ago • 4 comments

Description

Adds two new functions: collect and collectFirst. See more info/discussion in #269.

  • collect - Map+filter operation where undefined transformations are filtered out
  • collectFirst - Map+find operation where the first defined transformation is returned

Checklist

  • [X] Changes are covered by tests if behavior has been changed or added
  • [X] Tests have 100% coverage
  • [X] If code changes were made, the version in package.json has been bumped (matching semver)
  • [X] If code changes were made, the yarn build command has been run and to update the cdn directory
  • [X] If code changes were made, the documentation (in the /docs directory) has been updated

Resolves

Resolves #269

adamhamlin avatar Jul 08 '23 15:07 adamhamlin