-
Notifications
You must be signed in to change notification settings - Fork 23
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
An array index number #7
Conversation
an array index number
an array index number
Let's go @iambumblehead :D! |
The tests fail with this branch. What do you think of putting this behaviour behind a flag? for example, formurlencoded(obj, { isarrayindex : true }); |
I'd be more than happy to. Let's give @jumper423 a chance to respond. |
I can not think of a situation when you need a flag with a value of "false". So I think it is not necessary. I can correct tests. To do this? |
Current users of this script get arrays encoded as '[]'. I have not used index encoded array values myself and am not sure if it is a safe change to make... Do you think the tests should be changed or do you think a flag would be best? Would you explain which change is best for users of this script? I will test it with an express service to see how express receives data encoded with these changes |
Express does parse these correctly... please update the tests. I will merge and update the npm package. and by the way, thank you |
It's my pleasure. Later this loan. Justify your position and more specific tests will change. |
the "i" here would be undefined... that line encodes an empty array |
@jumper423 what's going on :) |
If we have input
We can convert it to
If the input
It is necessary to convert to
At the same time get the following picture
What comes out of this if decode execute.
When you do not set the digital code, he can not understand that it is one and the same element of the array and each time it creates a new one. In addition, the key doesn't see the point. As they use this library. Should have meet the same problem when using multidimensional arrays. You can also see the difference in the results for example on this resource. Enter what happens in You and look at the answer And compare with my data I hope the example is clear. Sorry to be so long responding. |
I'm using express to look at the results... I understand what you are showing |
You can also make indexes was not raised when all the array elements are scalar data type, then we are not numbered. |
View to express, please, at least I checked in php. |
The output you gave above is parsed correctly by express. Do you want these changes published to npm? |
Yes |
thank you, it is published as [email protected] |
Thanks kind sir. |
No description provided.