We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Would be nice to have a fluent API, f. i.
import { mapEntries } from 'radash/fluent' const ra = { name: 'Ra', power: 'sun', rank: 100, culture: 'egypt' } ra.mapEntries((key, value) => [key.toUpperCase(), `${value}`]) // => { NAME: 'Ra', POWER: 'sun', RANK: '100', CULTURE: 'egypt' }
The text was updated successfully, but these errors were encountered:
how would this work? ra is a plain object and doesn't have a mapEntries member.
ra
mapEntries
Sorry, something went wrong.
Can be done with this code. Example for the unique function
unique
declare global { interface Array<T> { unique(toKey?: SelectFn<T>): Array<T> } } export interface Array<T> { unique(toKey?: SelectFn<T>): Array<T> } Array.prototype.unique = function <T>(toKey?: SelectFn<T>) { return unique(this, toKey) }
The unique function can then be used like this:
const u = fish.unique(f => f.name)
Some people prefer this fluent type of API. It also aligns better with the built-in array functions.
fluent
No branches or pull requests
Would be nice to have a fluent API, f. i.
The text was updated successfully, but these errors were encountered: