Skip to content

crush losing [], {}, and undefined #386

@mikerowe81

Description

@mikerowe81

Crushing an object with empty arrays, empty objects, or undefined values results in losing the entry.

crush({ 
    arr: [],
    obj: {},
    und: undefined 
})

Current Result:

{ }

Expected Result:

{
    arr: [],
    obj: {},
    und: undefined
}

My thinking is I should be able to crush and re-construct and end up with the same object structure.

The construct function does everything except undefined

construct({ 
    arr: [],
    obj: {},
    und: undefined 
})

Current Result:

{ 
    arr: [],
    obj: {}
}

Expected Result:

{
    arr: [],
    obj: {},
    und: undefined
}

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    Status

    In Progress

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions