[translate] Make it possible to pass function as argument
- Dominant language
- JavaScript
- Stars
- 511
- Forks
- 23
- PR merge metrics
- No merged PRs in 30d
Description
```js
translate(values => ({
name: ...
}))
```
So it would be possible to do something like:
```js
const camelizeKeys = values => Object.keys(values).reduce((finalObject, key) => ({
...finalObject,
[camelCase(key)]: key,
}), {})
translate(camelizeKeys)
``
Contributor guide
No contributing guide indexed for this repository
Research direction
Start by locating the translate implementation and its existing tests. Check how translate currently accepts values, then define the behavior for receiving a function and verify that the provided transformation example works. The issue does not name a file or test entry point, so the surrounding API and test structure will need to be discovered first.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- backend-api-design
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100