Skip to content

Arrays are equal to Objects #12

Closed
@Matt-Esch

Description

@Matt-Esch

I am fixing a bug where arrays have been accidentally converted to objects:

['test', 'the', 'things'] -> { 0: 'test', 1: 'the', 2: 'things' }

I have written a function that tests if this has happened and converts back to the array form. I want to test that my patch works recursively, so it would be very convenient to use deep-equal.

Unfortunately though:

deepEqual(['test', 'the', 'things'], {
    0: 'test',
    1: 'the', 
    2: 'things'
});
// -> true

Would you accept a patch (perhaps with opts) to allow this to return false?

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