UNPKG

@eluvio/elv-js-helpers

Version:

A collection of Javascript helper functions used by several Eluvio libraries.

21 lines (19 loc) 720 B
// AUTO-GENERATED TEST - DO NOT MODIFY, CHANGES WILL BE OVERWRITTEN DURING BUILD 'use strict' const TH = require('../../../test-helpers') const pick = TH.requireSrcFile('Functional/pick') describe('pick JSDoc example', () => { it('should execute correctly as described', () => { 'use strict' const person = { firstName: 'Arthur', middleName: 'Philip', lastName: 'Dent', species: 'Human', } pick(['firstName', 'lastName'], person).should.eql({firstName: 'Arthur', lastName: 'Dent'}) // function is curried, call with just first param to return a narrower function: const speciesPicker = pick(['species']) speciesPicker(person).should.eql({species: 'Human'}) }) })