-
-
Notifications
You must be signed in to change notification settings - Fork 717
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
Feature request: depth: false
or parseDepth: false
for qs.parse
#261
Comments
This seems like a duplicate of #246? |
@ljharb I read that. It actually not a duplicated since this request added new option instead of modified the current behaviour. And Indeed |
In other words, I don't think |
+1, I thought it were working like this way |
There's no tests for a depth of 0, at least. Only 1, 5000, and the default of 5. That said, maybe it'd be better to add support for |
Just to who needs that it works like this report expectative: // Input: { a: 1, b: { c: 2 } }
// Output (spaced): a = 1 & b[c] = 2
// Note: using lodash.
_.mapKeys(qs.parse(qs.stringify({ data: postData }), { depth: 0 }).data, (v, key) => {
return key.replace(/^\[(\w+)]/, '$1');
}) |
Similar to the relationship
arrayLimit: 0
andparseArrays: false
:Therefore for this:
I believe in some scenario, people may want to suppress parse into any depth, i.e.:
so that we can expect for any query key, its value will never be an
object
since they are all decoupled,Any opinion?
The text was updated successfully, but these errors were encountered: