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

Stringify Array of Object URL #370

Closed
mazipan opened this issue Aug 7, 2023 · 1 comment
Closed

Stringify Array of Object URL #370

mazipan opened this issue Aug 7, 2023 · 1 comment

Comments

@mazipan
Copy link

mazipan commented Aug 7, 2023

Supporting Stringify for Array of Object.

Sample Parameter:

const params = {
  filters: [{
    key1: 'Value1'
  }, {
    key2: 'Value2'
  }]
}

Using:

qs.stringify(params, { 
   skipNull: true, 
   arrayFormat: 'bracket' 
})

Sample expected result: /?filter[key1]=Value1&filter[key2]=Value2

See in CodeSandbox: https://codesandbox.io/s/little-dew-q6jjvk?file=/src/index.js

@sindresorhus
Copy link
Owner

I don't plan to support objects in this package. There are other projects like qs that does.

https://github.com/sindresorhus/query-string#nesting

@sindresorhus sindresorhus closed this as not planned Won't fix, can't repro, duplicate, stale Aug 7, 2023
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