@future-widget-lab/record-set
Version:
A dedicated data structure for in-memory record collections, offering fluent, immutable APIs for MongoDB-like querying, sorting, and transformation.
21 lines (16 loc) • 417 B
text/typescript
import { flatMap } from './flat-map.helper';
describe('Unit | Helper | flatMap', () => {
it('should exist', () => {
expect(flatMap).toBeDefined();
});
it('should flatMap nested arrays correctly using flatMap', () => {
const nested = [
[1, 2],
[3, 4],
];
const flattened = nested.flatMap((arr) => {
return arr;
});
expect(flattened).toEqual([1, 2, 3, 4]);
});
});