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.lengthconst twoX = (num: number) => num * 2const func = _.pipe(addFive, len, twoX)const result = func('a', 3)expect(result).toBe(6) Copy
const addFive = (base: string, repeat: number) => base.repeat(repeat)const len = (str: string) => str.lengthconst twoX = (num: number) => num * 2const func = _.pipe(addFive, len, twoX)const result = func('a', 3)expect(result).toBe(6)
Rest
Description
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
Example