Skip to content

Suggestion: Retain empty arrays in flattenObject #1567

@islami00

Description

@islami00

When trying to flatten an object with an empty array, the key is omitted entirely if the array is empty. Since empty objects are retained, it would be great if arrays have the same behaviour.

const test = { prop: [], objectProp: {} };

flattenObject(test);
//  current result: { objectProp: {} }
//  expected result: { prop: [], objectProp: {} }

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions