Skip to content

test op will fail if 2 objects are ordered differently #39

@sonnyp

Description

@sonnyp

Spec:
http://tools.ietf.org/html/rfc6902#section-4.6

Implementation:

    test: function (obj, key) {
      return(JSON.stringify(obj[key]) === JSON.stringify(this.value));
    },

It doesn't work if 2 arrays/objects are equals (from the RFC definition) but ordered differently.

JSON.stringify(['foo', 'bar']) === JSON.stringify(['bar', 'foo']); //false

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions