deno.land / x / rambda@v9.1.1 / source / produce.spec.js
12345678910111213141516171819202122232425262728293031import { add, pipe } from '../rambda.js'import { produce } from './produce.js'
const rules = { a : pipe(add(2), add(3)), b : x => ({ foo : x }), c : { d : add(2), e : add(10), },}
const expected = { a : 6, b : { foo : 1 }, c : { d : 3, e : 11, },}
test('happy', () => { const result = produce(rules, 1) expect(result).toEqual(expected)})
test('curried', () => { const result = produce(rules)(1) expect(result).toEqual(expected)})
Version Info