deno.land / x / rambda@v9.1.1 / source / when.spec.js
1234567891011import { add } from './add.js'import { when } from './when.js'
const predicate = x => typeof x === 'number'
test('happy', () => { const fn = when(predicate, add(11)) expect(fn(11)).toBe(22) expect(fn('foo')).toBe('foo')})
Version Info