How to use the flat.0 function in flat

To help you get started, we’ve selected a few flat examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github oreqizer / redux-forms / packages / redux-forms / src / __tests__ / arrays.spec.ts View on Github external
it('should shift flat array', () => {
    const res = arrayUnshift('flat', 1)(fields);

    expect(res['flat.1']).toBeUndefined();

    expect(res['flat.0']).toBe(field0);
    expect(res['flat.2']).toBe(field1);
    expect(res['flat.3']).toBe(field2);
    expect(res['flat.4']).toBe(field3);
    expect(res['flat.5']).toBe(field4);
  });

flat

Take a nested Javascript object and flatten it, or unflatten an object with delimited keys

BSD-3-Clause
Latest version published 1 year ago

Package Health Score

80 / 100
Full package analysis