Compose multiple functions by XOR
- Node.js ≥ 8.9.0
import compose from 'xor-compose'
const a = () => 123
const b = string => string.length
const c = string => [...string].map(x => x.charCodeAt()).reduce((a, b) => a + b)
const fn = compose(a, b, c)
console.log(fn('abc'))