Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get mismatch info? #63

Open
pablote opened this issue Sep 4, 2019 · 1 comment
Open

Get mismatch info? #63

pablote opened this issue Sep 4, 2019 · 1 comment

Comments

@pablote
Copy link

pablote commented Sep 4, 2019

I'm currently struggling to determine why two objects that look the same to me are being compared as being different.

Is there anyway for me to get information as to why the lib is returning false? either as part of the response or just logging would help.

thanks

@natlibfi-jonollil
Copy link

I had "faulty positive" situation too.

JSON.stringify() values were indentical:

{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"b"}{"code":"h","value":"1035"}]}
{"tag":"CAT","ind1":" ","ind2":" ","subfields":[{"code":"b"}{"code":"h","value":"1035"}]}

After a while i started to console log whole objects and found out that JSON.stringify() drops undefined values:

{
  tag: 'CAT',
  ind1: ' ',
  ind2: ' ',
  subfields: [
    { code: 'b' },
    { code: 'h', value: '1035' }
  ]
}
{
  tag: 'CAT',
  ind1: ' ',
  ind2: ' ',
  subfields: [
    { code: 'b', value: undefined },
    { code: 'h', value: '1035' }
  ]
}```

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants