es-toolkit icon indicating copy to clipboard operation
es-toolkit copied to clipboard

flattenObject doesn't handle array of objects

Open mkatrenik opened this issue 3 months ago • 0 comments

Given this code

    const result = flattenObject({
      a: [1, { b: 2 }, 3],
    });

    expect(result).toEqual({
      'a.0': 1,
      'a.1.b': 2,
      'a.2': 3,
    });

nested object is not flattened

Screenshot 2024-11-12 at 19 47 16

mkatrenik avatar Nov 12 '24 18:11 mkatrenik