functional-fns
v0.0.7
Published
Functional utils for your functional needs.
Downloads
2
Maintainers
Readme
functional-fns
Functional utils for your functional needs.
filter fns
remove
import remove from 'functional-fns/filter/remove'
const res = ['foo', 'bar', 'baz'].filter(remove(1))
console.log(res) // ['foo', 'baz']
map fns
swap
import swap from 'functional-fns/map/swap'
const res = ['foo', 'bar', 'baz'].map(swap(1, 2))
console.log(res) // ['foo', 'baz', 'bar']
reduce fns
insert
import insert from 'functional-fns/reduce/insert'
const res = ['foo', 'bar', 'baz'].reduce(...insert('foo', 1))
console.log(res) // ['foo', 'foo', 'bar', 'baz']