Browse Source

Address deepEqual using compare by JSON strings.

1) JSON does not guarantee the ordering that fields are encoded in the string, making it unreliable for generic hashing.
2) When ordering is maintained, the strings match the ordering the fields were added to the object, making the unit test too tighly coupled to the order they are added in the implementation.
3) A field whose value is undefined versus not being present presents a difference that deepEqual should assert.  If it does not matter then possibly a different assert should be used.
pull/724/head
Jamie Seter 6 years ago
parent
commit
8d64ead2c0
  1. 11
      papaparse.js

11
papaparse.js

@ -1358,12 +1358,15 @@ License: MIT @@ -1358,12 +1358,15 @@ License: MIT
function addError(type, code, msg, row)
{
_results.errors.push({
var error = {
type: type,
code: code,
message: msg,
row: row
});
message: msg
};
if(row !== undefined) {
error.row = row;
}
_results.errors.push(error);
}
}

Loading…
Cancel
Save