ts-prime
Version:
A utility library for JavaScript and Typescript.
21 lines (18 loc) • 450 B
text/typescript
import { filterRecord } from './filterRecord';
import { pipe } from './pipe';
describe('data first', () => {
test('should filter', () => {
expect(filterRecord({ a: 1, b: 2, c: 3 }, ([k, v]) => k !== 'a')).toEqual({
b: 2,
c: 3,
});
});
test('should filter with pipe', () => {
expect(
pipe(
{ a: 1, b: 2, c: 3 },
filterRecord(([k, v]) => k !== 'a')
)
).toEqual({ b: 2, c: 3 });
});
});