UNPKG

tamda

Version:

Practical functional programming library for TypeScript

18 lines (14 loc) 363 B
import { pick } from './pick'; describe('pick', () => { it(`should clone an object with only the specified properties`, () => { const obj = { id: 1, foo: 'bar' }; const prop = 'id'; const results = [ pick(obj, prop), pick (prop) (obj), ]; results.forEach(result => { expect(result).toEqual({ id: 1 }); }); }); });