Function pipe

Creates pipeline of functions to be applied to a value First function can receive any number of arguments Subsequent functions can only receive one argument - the result of the previous function

const addFive = (base: string, repeat: number) => base.repeat(repeat)
const len = (str: string) => str.length
const twoX = (num: number) => num * 2
const func = _.pipe(addFive, len, twoX)
const result = func('a', 3)
expect(result).toBe(6)