fineanmol / Hacktoberfest2024

Make your first Pull Request on Hacktoberfest 2024. Don't forget to spread love and if you like give us a ⭐️
https://fineanmol.github.io/Hacktoberfest2024/
GNU General Public License v3.0
2.52k stars 7.94k forks source link

Write API for transform and sort json object grouped by city name #6847

Open Rohitsonvane88 opened 1 year ago

Rohitsonvane88 commented 1 year ago

Is your feature request related to a problem? Please describe. const input = [ { zip: '501', city: 'Holtsville', state_id: 'NY', state_name: 'New York', county_name: 'Suffolk' }, { zip: '544', city: 'Holtsville', state_id: 'NY', state_name: 'New York', county_name: 'Suffolk' }, { zip: '601', city: 'Adjuntas', state_id: 'PR', state_name: 'Puerto Rico', county_name: 'Adjuntas' }, { zip: '602', city: 'Aguada', state_id: 'PR', state_name: 'Puerto Rico', county_name: 'Aguada' }, ]

Describe the solution you'd like const output = { "Suffolk, New York (county)": { "type": "county", "zipcode": [ "00501", "00544", "06390", "11701", "11702", "11703", "11704", "11705", "11706" ] }, "New York (state)": { "type": "state", "zipcode": [ "00501", "00544", "06390", "10001", "10002", "10003", "10004", "10005", "10006", ] } }

Describe alternatives you've considered A clear and concise description of any alternative solutions or features you've considered.

Additional context Add any other context or screenshots about the feature request here.

Rohitsonvane88 commented 1 year ago

I am working on this issue, please assign it to me.