query-string 8.1.0 → 8.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/base.d.ts CHANGED
@@ -220,7 +220,7 @@ export function parseUrl(url: string, options?: ParseOptions): ParsedUrl;
220
220
 
221
221
  export type StringifyOptions = {
222
222
  /**
223
- Strictly encode URI components with [`strict-uri-encode`](https://github.com/kevva/strict-uri-encode). It uses [`encodeURIComponent`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) if set to `false`. You probably [don't care](https://github.com/sindresorhus/query-string/issues/42) about this option.
223
+ Strictly encode URI components. It uses [`encodeURIComponent`](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) if set to `false`. You probably [don't care](https://github.com/sindresorhus/query-string/issues/42) about this option.
224
224
 
225
225
  @default true
226
226
  */
@@ -412,7 +412,7 @@ export type StringifyOptions = {
412
412
  readonly skipEmptyString?: boolean;
413
413
  };
414
414
 
415
- export type Stringifiable = string | boolean | number | null | undefined; // eslint-disable-line @typescript-eslint/ban-types
415
+ export type Stringifiable = string | boolean | number | bigint | null | undefined; // eslint-disable-line @typescript-eslint/ban-types
416
416
 
417
417
  export type StringifiableRecord = Record<
418
418
  string,
package/base.js CHANGED
@@ -385,13 +385,7 @@ export function parse(query, options) {
385
385
  // eslint-disable-next-line unicorn/no-array-reduce
386
386
  return (options.sort === true ? Object.keys(returnValue).sort() : Object.keys(returnValue).sort(options.sort)).reduce((result, key) => {
387
387
  const value = returnValue[key];
388
- if (Boolean(value) && typeof value === 'object' && !Array.isArray(value)) {
389
- // Sort object keys, not values
390
- result[key] = keysSorter(value);
391
- } else {
392
- result[key] = value;
393
- }
394
-
388
+ result[key] = Boolean(value) && typeof value === 'object' && !Array.isArray(value) ? keysSorter(value) : value;
395
389
  return result;
396
390
  }, Object.create(null));
397
391
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "query-string",
3
- "version": "8.1.0",
3
+ "version": "8.2.0",
4
4
  "description": "Parse and stringify URL query strings",
5
5
  "license": "MIT",
6
6
  "repository": "sindresorhus/query-string",
@@ -15,6 +15,7 @@
15
15
  "types": "./index.d.ts",
16
16
  "default": "./index.js"
17
17
  },
18
+ "sideEffects": false,
18
19
  "engines": {
19
20
  "node": ">=14.16"
20
21
  },
@@ -55,7 +56,7 @@
55
56
  "deep-equal": "^2.1.0",
56
57
  "fast-check": "^3.4.0",
57
58
  "tsd": "^0.25.0",
58
- "xo": "^0.53.1"
59
+ "xo": "^0.54.2"
59
60
  },
60
61
  "tsd": {
61
62
  "compilerOptions": {
package/readme.md CHANGED
@@ -236,7 +236,7 @@ Type: `object`
236
236
  Type: `boolean`\
237
237
  Default: `true`
238
238
 
239
- Strictly encode URI components with [strict-uri-encode](https://github.com/kevva/strict-uri-encode). It uses [encodeURIComponent](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) if set to false. You probably [don't care](https://github.com/sindresorhus/query-string/issues/42) about this option.
239
+ Strictly encode URI components. It uses [encodeURIComponent](https://developer.mozilla.org/en/docs/Web/JavaScript/Reference/Global_Objects/encodeURIComponent) if set to false. You probably [don't care](https://github.com/sindresorhus/query-string/issues/42) about this option.
240
240
 
241
241
  ##### encode
242
242