This repository has been archived by the owner on Apr 13, 2022. It is now read-only.
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
fix(httpParamSerializerJQLike): Follow jQuery for index of arrays of …
- Loading branch information
Showing
2 changed files
with
10 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
18a2e4f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why the index should only be serialized on arrays of objects? My use case (Moodle web services API) wants also wants array indices for arrays of integers e.g.
foo = [0,1] -> foo[0]=0&foo[1]=1&
so perhaps something like
serialize(value, prefix + '[' + index '') + ']');
18a2e4f
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@earcanal it follows the same logic that jQuery does
https://github.com/jquery/jquery/blob/70605c8e5655da996ebd395e3c43423daaa08d9c/src/serialize.js#L31