jashkenas / jashkenas/underscore
Expand support for methods used as iteratees.
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 27.3k
- Forks
- 5.4k
- Avg merge
- 2d 5h
- Merged PRs (30d)
- 1
Description
Methods like `_.sample`, `_.first`, `_.initial`, `_.last`, & `_.rest` have guards to support being used as an iteratee for methods like `_.map`. I think it'd be great if this was expanded to other methods that can operate with just 1 param, like `_.template`, `_.sortBy`, `_.uniq`, `_.flatten`, `_.min`, `_.max`, & so on. Support can be added to some by adding a simple `guard` check while others may require a [helper](https://github.com/lodash/lodash/blob/f0fb02074d41c728df28eef19fc5823c7b6bd8a6/dist/lodash.js#L702-L708).
Contributor guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Review the existing iteratee guards on _.sample, _.first, _.initial, _.last, and _.rest, then compare the helper referenced in dist/lodash.js around lines 702-708. Determine which additional one-parameter methods can safely support iteratees and define consistent behavior for the listed methods; completion requires implementing and validating that support.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100