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

Non sorted objects produce wrong result #35

Open
cbou opened this issue Feb 6, 2021 · 2 comments
Open

Non sorted objects produce wrong result #35

cbou opened this issue Feb 6, 2021 · 2 comments

Comments

@cbou
Copy link

cbou commented Feb 6, 2021

If keys your objects are not sorted the same way the output will be wrong e.g. I switched handle and last from the last object.

const dataObjects = [
  {
    number: 1,
    first: 'Mark',
    last: 'Otto',
    handle: '@mdo',
  },
  {
    number: 2,
    first: 'Jacob',
    last: 'Thornton',
    handle: '@fat',
  },
  {
    number: 3,
    first: 'Larry',
    handle: '@twitter',
    last: 'the Bird',
  },

It outputs:

number,first,last,handle
1,Mark,Otto,@mdo
2,Jacob,Thornton,@fat
3,Larry,@twitter,the Bird

But it should be

number,first,last,handle
1,Mark,Otto,@mdo
2,Jacob,Thornton,@fat
3,Larry,the Bird,@twitter
@aichbauer
Copy link
Owner

I'll take a look at it asap.

Contributions are welcome 👍

@ghost
Copy link

ghost commented Nov 20, 2022

wake up bro

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