UNPKG

foreword

Version:

A JavaScript library for functional data transformation

12 lines (8 loc) 217 B
const test = require('tape') const { branch } = require('../../index') test('function branch', t => { const fn = branch(x => x === 10)(x => x + 1)(x => x - 1) t.same(fn(10), 11) t.same(fn(9), 8) t.end() })