UNPKG

@prelude/function

Version:

Function module.

9 lines 283 B
import * as F from './index.js'; const factorial = F.memoize((n) => n === 1 ? 1n : BigInt(n) * factorial(n - 1)); test('memoize', () => { expect(factorial(100)).toMatchSnapshot(); expect(factorial.cache).toMatchSnapshot(); }); //# sourceMappingURL=memoize.test.js.map