@eluvio/elv-js-helpers
Version:
A collection of Javascript helper functions used by several Eluvio libraries.
17 lines (15 loc) • 667 B
JavaScript
// AUTO-GENERATED TEST - DO NOT MODIFY, CHANGES WILL BE OVERWRITTEN DURING BUILD
const TH = require('../../../test-helpers')
const setArity = TH.requireSrcFile('Functional/setArity')
describe('setArity JSDoc example', () => {
it('should execute correctly as described', () => {
'use strict'
const maxOfThree = setArity(3, Math.max)
// creates partially applied function with 1 argument applied (waiting for 2 more):
const maxNeedTwoMore = maxOfThree(42)
// creates partially applied function with 2 arguments applied (waiting for 1 more):
const maxNeedOneMore = maxNeedTwoMore(0)
maxNeedOneMore(-42).should.eql(42)
})
})