radash
radash copied to clipboard
feat: Add `collect` and `collectFirst` functions
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 thecdn
directory - [X] If code changes were made, the documentation (in the
/docs
directory) has been updated
Resolves
Resolves #269