README
@rpearce/ts-fns
:warning: This repo & package are for experimentation with typescript and functions. Use at your own risk.
Special thanks to the following for helping with some typings!
Example usage
npm i @rpearce/ts-fns
import { lift2, propOr } from '@rpearce/ts-fns'
const propOrNA = propOr('N/A')
const getName = propOrNA('name')
const getEmail = propOrNA('email')
const joinPipe = (x: string) => (y: string) => `${x} | ${y}`
const joinNameEmail = lift2(joinPipe)(getName)(getEmail)
const input = { name: 'bobert', email: 'bobert@email.com', foo: 'bar' }
console.log(joinNameEmail(input))
// 'bobert | bobert@email.com'