Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
it('should cleanup fields', () => {
const res = arrayCleanup('medium')(fields);
expect(res['flat.0']).toBe(field0);
expect(res['medium.0.nest.0']).toBeUndefined();
expect(res['medium.0.nest.1']).toBeUndefined();
expect(res['medium.0.nest.2']).toBeUndefined();
expect(res['medium.0.nest.3']).toBeUndefined();
expect(res['medium.1.nest.0']).toBeUndefined();
expect(res['medium.1.nest.1']).toBeUndefined();
expect(res['medium.1.nest.2']).toBeUndefined();
expect(res['medium.1.nest.3']).toBeUndefined();
expect(res['rec.0.rec.0.rec.0']).toBe(field0);
});
});