coston / json-to-csv-export

A function to easily generate csv downloads of your json data. ✨
https://json-to-csv-export.coston.io
MIT License
84 stars 24 forks source link

not all key/values converted if not in the first object #65

Closed rg3h closed 3 months ago

rg3h commented 3 months ago

// from https://json-to-csv-export.vercel.app/ // bar will be in the exported csv but foo will not // results: // ID,First Name,Last Name,Email,Language,bar,IP Address // 1,Sarajane,Wheatman,swheatman0@google.nl,Zulu,1234,40.98.252.240 // 2,Linell,Humpherston,lhumpherston1@google.com.br,Czech,,82.225.151.150

() => { const mockData = [{ "ID": 1, "First Name": "Sarajane", "Last Name": "Wheatman", "Email": "swheatman0@google.nl", "Language": "Zulu", "bar": 1234, "IP Address": "40.98.252.240" }, { "ID": 2, "foo": 4, "First Name": "Linell", "Last Name": "Humpherston", "Email": "lhumpherston1@google.com.br", "Language": "Czech", "IP Address": "82.225.151.150" }]

return ( <button onClick={() => jsonToCsvExport({ data: mockData })}> Download Data ) }

github-actions[bot] commented 3 months ago

:tada: This issue has been resolved in version 3.0.1 :tada:

The release is available on:

Your semantic-release bot :package::rocket: