From 6c26f8a5cd34bc65f9d868dde526513ff1cdf93e Mon Sep 17 00:00:00 2001 From: Jordan Harband Date: Thu, 14 Sep 2023 11:42:51 -0700 Subject: [PATCH] [readme] `stringify`: clarify default `arrayFormat` behavior --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 66354710..6d5955b8 100644 --- a/README.md +++ b/README.md @@ -375,14 +375,14 @@ var decoded = qs.parse('x=z', { decoder: function (str, defaultDecoder, charset, Examples beyond this point will be shown as though the output is not URI encoded for clarity. Please note that the return values in these cases *will* be URI encoded during real usage. -When arrays are stringified, by default they are given explicit indices: +When arrays are stringified, they follow the `arrayFormat` option, which defaults to `indices`: ```javascript qs.stringify({ a: ['b', 'c', 'd'] }); // 'a[0]=b&a[1]=c&a[2]=d' ``` -You may override this by setting the `indices` option to `false`: +You may override this by setting the `indices` option to `false`, or to be more explicit, the `arrayFormat` option to `repeat`: ```javascript qs.stringify({ a: ['b', 'c', 'd'] }, { indices: false });