cdk-common 2.0.1399 → 2.0.1401

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.
Files changed (58) hide show
  1. package/.jsii +16 -4
  2. package/API.md +34 -0
  3. package/lib/main.js +1 -1
  4. package/lib/managed-policies.d.ts +3 -1
  5. package/lib/managed-policies.js +3 -1
  6. package/node_modules/@types/concat-stream/node_modules/@types/node/README.md +1 -1
  7. package/node_modules/@types/concat-stream/node_modules/@types/node/package.json +3 -3
  8. package/node_modules/@types/concat-stream/node_modules/@types/node/process.d.ts +1 -6
  9. package/node_modules/@types/concat-stream/node_modules/@types/node/tls.d.ts +7 -7
  10. package/node_modules/@types/concat-stream/node_modules/undici-types/agent.d.ts +1 -1
  11. package/node_modules/@types/concat-stream/node_modules/undici-types/api.d.ts +2 -2
  12. package/node_modules/@types/concat-stream/node_modules/undici-types/balanced-pool.d.ts +2 -1
  13. package/node_modules/@types/concat-stream/node_modules/undici-types/cache-interceptor.d.ts +1 -0
  14. package/node_modules/@types/concat-stream/node_modules/undici-types/client.d.ts +1 -1
  15. package/node_modules/@types/concat-stream/node_modules/undici-types/connector.d.ts +2 -2
  16. package/node_modules/@types/concat-stream/node_modules/undici-types/diagnostics-channel.d.ts +2 -2
  17. package/node_modules/@types/concat-stream/node_modules/undici-types/dispatcher.d.ts +12 -12
  18. package/node_modules/@types/concat-stream/node_modules/undici-types/fetch.d.ts +4 -4
  19. package/node_modules/@types/concat-stream/node_modules/undici-types/formdata.d.ts +1 -1
  20. package/node_modules/@types/concat-stream/node_modules/undici-types/h2c-client.d.ts +1 -1
  21. package/node_modules/@types/concat-stream/node_modules/undici-types/index.d.ts +9 -1
  22. package/node_modules/@types/concat-stream/node_modules/undici-types/interceptors.d.ts +36 -2
  23. package/node_modules/@types/concat-stream/node_modules/undici-types/package.json +1 -1
  24. package/node_modules/@types/concat-stream/node_modules/undici-types/pool.d.ts +1 -1
  25. package/node_modules/@types/concat-stream/node_modules/undici-types/readable.d.ts +2 -2
  26. package/node_modules/@types/concat-stream/node_modules/undici-types/round-robin-pool.d.ts +41 -0
  27. package/node_modules/@types/concat-stream/node_modules/undici-types/websocket.d.ts +9 -9
  28. package/node_modules/@types/form-data/node_modules/@types/node/README.md +1 -1
  29. package/node_modules/@types/form-data/node_modules/@types/node/package.json +3 -3
  30. package/node_modules/@types/form-data/node_modules/@types/node/process.d.ts +1 -6
  31. package/node_modules/@types/form-data/node_modules/@types/node/tls.d.ts +7 -7
  32. package/node_modules/@types/form-data/node_modules/undici-types/agent.d.ts +1 -1
  33. package/node_modules/@types/form-data/node_modules/undici-types/api.d.ts +2 -2
  34. package/node_modules/@types/form-data/node_modules/undici-types/balanced-pool.d.ts +2 -1
  35. package/node_modules/@types/form-data/node_modules/undici-types/cache-interceptor.d.ts +1 -0
  36. package/node_modules/@types/form-data/node_modules/undici-types/client.d.ts +1 -1
  37. package/node_modules/@types/form-data/node_modules/undici-types/connector.d.ts +2 -2
  38. package/node_modules/@types/form-data/node_modules/undici-types/diagnostics-channel.d.ts +2 -2
  39. package/node_modules/@types/form-data/node_modules/undici-types/dispatcher.d.ts +12 -12
  40. package/node_modules/@types/form-data/node_modules/undici-types/fetch.d.ts +4 -4
  41. package/node_modules/@types/form-data/node_modules/undici-types/formdata.d.ts +1 -1
  42. package/node_modules/@types/form-data/node_modules/undici-types/h2c-client.d.ts +1 -1
  43. package/node_modules/@types/form-data/node_modules/undici-types/index.d.ts +9 -1
  44. package/node_modules/@types/form-data/node_modules/undici-types/interceptors.d.ts +36 -2
  45. package/node_modules/@types/form-data/node_modules/undici-types/package.json +1 -1
  46. package/node_modules/@types/form-data/node_modules/undici-types/pool.d.ts +1 -1
  47. package/node_modules/@types/form-data/node_modules/undici-types/readable.d.ts +2 -2
  48. package/node_modules/@types/form-data/node_modules/undici-types/round-robin-pool.d.ts +41 -0
  49. package/node_modules/@types/form-data/node_modules/undici-types/websocket.d.ts +9 -9
  50. package/node_modules/qs/CHANGELOG.md +162 -0
  51. package/node_modules/qs/README.md +18 -0
  52. package/node_modules/qs/dist/qs.js +19 -19
  53. package/node_modules/qs/lib/parse.js +3 -1
  54. package/node_modules/qs/lib/utils.js +2 -0
  55. package/node_modules/qs/package.json +1 -1
  56. package/node_modules/qs/test/parse.js +60 -4
  57. package/node_modules/qs/test/utils.js +7 -0
  58. package/package.json +10 -10
@@ -1,7 +1,7 @@
1
- import { URL } from 'url'
2
- import { Duplex, Readable, Writable } from 'stream'
3
- import { EventEmitter } from 'events'
4
- import { Blob } from 'buffer'
1
+ import { URL } from 'node:url'
2
+ import { Duplex, Readable, Writable } from 'node:stream'
3
+ import { EventEmitter } from 'node:events'
4
+ import { Blob } from 'node:buffer'
5
5
  import { IncomingHttpHeaders } from './header'
6
6
  import BodyReadable from './readable'
7
7
  import { FormData } from './formdata'
@@ -19,30 +19,30 @@ declare class Dispatcher extends EventEmitter {
19
19
  /** Dispatches a request. This API is expected to evolve through semver-major versions and is less stable than the preceding higher level APIs. It is primarily intended for library developers who implement higher level APIs on top of this. */
20
20
  dispatch (options: Dispatcher.DispatchOptions, handler: Dispatcher.DispatchHandler): boolean
21
21
  /** Starts two-way communications with the requested resource. */
22
- connect<TOpaque = null>(options: Dispatcher.ConnectOptions<TOpaque>): Promise<Dispatcher.ConnectData<TOpaque>>
23
22
  connect<TOpaque = null>(options: Dispatcher.ConnectOptions<TOpaque>, callback: (err: Error | null, data: Dispatcher.ConnectData<TOpaque>) => void): void
23
+ connect<TOpaque = null>(options: Dispatcher.ConnectOptions<TOpaque>): Promise<Dispatcher.ConnectData<TOpaque>>
24
24
  /** Compose a chain of dispatchers */
25
25
  compose (dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher
26
26
  compose (...dispatchers: Dispatcher.DispatcherComposeInterceptor[]): Dispatcher.ComposedDispatcher
27
27
  /** Performs an HTTP request. */
28
- request<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>): Promise<Dispatcher.ResponseData<TOpaque>>
29
28
  request<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, callback: (err: Error | null, data: Dispatcher.ResponseData<TOpaque>) => void): void
29
+ request<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>): Promise<Dispatcher.ResponseData<TOpaque>>
30
30
  /** For easy use with `stream.pipeline`. */
31
31
  pipeline<TOpaque = null>(options: Dispatcher.PipelineOptions<TOpaque>, handler: Dispatcher.PipelineHandler<TOpaque>): Duplex
32
32
  /** A faster version of `Dispatcher.request`. */
33
- stream<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, factory: Dispatcher.StreamFactory<TOpaque>): Promise<Dispatcher.StreamData<TOpaque>>
34
33
  stream<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, factory: Dispatcher.StreamFactory<TOpaque>, callback: (err: Error | null, data: Dispatcher.StreamData<TOpaque>) => void): void
34
+ stream<TOpaque = null>(options: Dispatcher.RequestOptions<TOpaque>, factory: Dispatcher.StreamFactory<TOpaque>): Promise<Dispatcher.StreamData<TOpaque>>
35
35
  /** Upgrade to a different protocol. */
36
- upgrade (options: Dispatcher.UpgradeOptions): Promise<Dispatcher.UpgradeData>
37
36
  upgrade (options: Dispatcher.UpgradeOptions, callback: (err: Error | null, data: Dispatcher.UpgradeData) => void): void
37
+ upgrade (options: Dispatcher.UpgradeOptions): Promise<Dispatcher.UpgradeData>
38
38
  /** Closes the client and gracefully waits for enqueued requests to complete before invoking the callback (or returning a promise if no callback is provided). */
39
- close (): Promise<void>
40
39
  close (callback: () => void): void
40
+ close (): Promise<void>
41
41
  /** Destroy the client abruptly with the given err. All the pending and running requests will be asynchronously aborted and error. Waits until socket is closed before invoking the callback (or returning a promise if no callback is provided). Since this operation is asynchronously dispatched there might still be some progress on dispatched requests. */
42
- destroy (): Promise<void>
43
- destroy (err: Error | null): Promise<void>
44
- destroy (callback: () => void): void
45
42
  destroy (err: Error | null, callback: () => void): void
43
+ destroy (callback: () => void): void
44
+ destroy (err: Error | null): Promise<void>
45
+ destroy (): Promise<void>
46
46
 
47
47
  on (eventName: 'connect', callback: (origin: URL, targets: readonly Dispatcher[]) => void): this
48
48
  on (eventName: 'disconnect', callback: (origin: URL, targets: readonly Dispatcher[], error: Errors.UndiciError) => void): this
@@ -2,9 +2,9 @@
2
2
  // and https://github.com/node-fetch/node-fetch/blob/914ce6be5ec67a8bab63d68510aabf07cb818b6d/index.d.ts (MIT license)
3
3
  /// <reference types="node" />
4
4
 
5
- import { Blob } from 'buffer'
6
- import { URL, URLSearchParams } from 'url'
7
- import { ReadableStream } from 'stream/web'
5
+ import { Blob } from 'node:buffer'
6
+ import { URL, URLSearchParams } from 'node:url'
7
+ import { ReadableStream } from 'node:stream/web'
8
8
  import { FormData } from './formdata'
9
9
  import { HeaderRecord } from './header'
10
10
  import Dispatcher from './dispatcher'
@@ -207,5 +207,5 @@ export declare class Response extends BodyMixin {
207
207
 
208
208
  static error (): Response
209
209
  static json (data: any, init?: ResponseInit): Response
210
- static redirect (url: string | URL, status: ResponseRedirectStatus): Response
210
+ static redirect (url: string | URL, status?: ResponseRedirectStatus): Response
211
211
  }
@@ -1,7 +1,7 @@
1
1
  // Based on https://github.com/octet-stream/form-data/blob/2d0f0dc371517444ce1f22cdde13f51995d0953a/lib/FormData.ts (MIT)
2
2
  /// <reference types="node" />
3
3
 
4
- import { File } from 'buffer'
4
+ import { File } from 'node:buffer'
5
5
  import { SpecIterableIterator } from './fetch'
6
6
 
7
7
  /**
@@ -1,4 +1,4 @@
1
- import { URL } from 'url'
1
+ import { URL } from 'node:url'
2
2
  import Dispatcher from './dispatcher'
3
3
  import buildConnector from './connector'
4
4
 
@@ -5,6 +5,7 @@ import Pool from './pool'
5
5
  import { RedirectHandler, DecoratorHandler } from './handlers'
6
6
 
7
7
  import BalancedPool from './balanced-pool'
8
+ import RoundRobinPool from './round-robin-pool'
8
9
  import Client from './client'
9
10
  import H2CClient from './h2c-client'
10
11
  import buildConnector from './connector'
@@ -23,6 +24,12 @@ import RetryAgent from './retry-agent'
23
24
  import { request, pipeline, stream, connect, upgrade } from './api'
24
25
  import interceptors from './interceptors'
25
26
 
27
+ import CacheInterceptor from './cache-interceptor'
28
+ declare const cacheStores: {
29
+ MemoryCacheStore: typeof CacheInterceptor.MemoryCacheStore;
30
+ SqliteCacheStore: typeof CacheInterceptor.SqliteCacheStore;
31
+ }
32
+
26
33
  export * from './util'
27
34
  export * from './cookies'
28
35
  export * from './eventsource'
@@ -36,7 +43,7 @@ export { Interceptable } from './mock-interceptor'
36
43
 
37
44
  declare function globalThisInstall (): void
38
45
 
39
- export { Dispatcher, BalancedPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, interceptors, MockClient, MockPool, MockAgent, SnapshotAgent, MockCallHistory, MockCallHistoryLog, mockErrors, ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent, H2CClient, globalThisInstall as install }
46
+ export { Dispatcher, BalancedPool, RoundRobinPool, Pool, Client, buildConnector, errors, Agent, request, stream, pipeline, connect, upgrade, setGlobalDispatcher, getGlobalDispatcher, setGlobalOrigin, getGlobalOrigin, interceptors, cacheStores, MockClient, MockPool, MockAgent, SnapshotAgent, MockCallHistory, MockCallHistoryLog, mockErrors, ProxyAgent, EnvHttpProxyAgent, RedirectHandler, DecoratorHandler, RetryHandler, RetryAgent, H2CClient, globalThisInstall as install }
40
47
  export default Undici
41
48
 
42
49
  declare namespace Undici {
@@ -46,6 +53,7 @@ declare namespace Undici {
46
53
  const DecoratorHandler: typeof import ('./handlers').DecoratorHandler
47
54
  const RetryHandler: typeof import ('./retry-handler').default
48
55
  const BalancedPool: typeof import('./balanced-pool').default
56
+ const RoundRobinPool: typeof import('./round-robin-pool').default
49
57
  const Client: typeof import('./client').default
50
58
  const H2CClient: typeof import('./h2c-client').default
51
59
  const buildConnector: typeof import('./connector').default
@@ -19,14 +19,47 @@ declare namespace Interceptors {
19
19
 
20
20
  // DNS interceptor
21
21
  export type DNSInterceptorRecord = { address: string, ttl: number, family: 4 | 6 }
22
- export type DNSInterceptorOriginRecords = { 4: { ips: DNSInterceptorRecord[] } | null, 6: { ips: DNSInterceptorRecord[] } | null }
22
+ export type DNSInterceptorOriginRecords = { records: { 4: { ips: DNSInterceptorRecord[] } | null, 6: { ips: DNSInterceptorRecord[] } | null } }
23
+ export type DNSStorage = {
24
+ size: number
25
+ get(origin: string): DNSInterceptorOriginRecords | null
26
+ set(origin: string, records: DNSInterceptorOriginRecords | null, options: { ttl: number }): void
27
+ delete(origin: string): void
28
+ full(): boolean
29
+ }
23
30
  export type DNSInterceptorOpts = {
24
31
  maxTTL?: number
25
32
  maxItems?: number
26
- lookup?: (hostname: string, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, addresses: DNSInterceptorRecord[]) => void) => void
33
+ lookup?: (origin: URL, options: LookupOptions, callback: (err: NodeJS.ErrnoException | null, addresses: DNSInterceptorRecord[]) => void) => void
27
34
  pick?: (origin: URL, records: DNSInterceptorOriginRecords, affinity: 4 | 6) => DNSInterceptorRecord
28
35
  dualStack?: boolean
29
36
  affinity?: 4 | 6
37
+ storage?: DNSStorage
38
+ }
39
+
40
+ // Deduplicate interceptor
41
+ export type DeduplicateMethods = 'GET' | 'HEAD' | 'OPTIONS' | 'TRACE'
42
+ export type DeduplicateInterceptorOpts = {
43
+ /**
44
+ * The HTTP methods to deduplicate.
45
+ * Note: Only safe HTTP methods can be deduplicated.
46
+ * @default ['GET']
47
+ */
48
+ methods?: DeduplicateMethods[]
49
+ /**
50
+ * Header names that, if present in a request, will cause the request to skip deduplication.
51
+ * Header name matching is case-insensitive.
52
+ * @default []
53
+ */
54
+ skipHeaderNames?: string[]
55
+ /**
56
+ * Header names to exclude from the deduplication key.
57
+ * Requests with different values for these headers will still be deduplicated together.
58
+ * Useful for headers like `x-request-id` that vary per request but shouldn't affect deduplication.
59
+ * Header name matching is case-insensitive.
60
+ * @default []
61
+ */
62
+ excludeHeaderNames?: string[]
30
63
  }
31
64
 
32
65
  export function dump (opts?: DumpInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
@@ -36,4 +69,5 @@ declare namespace Interceptors {
36
69
  export function responseError (opts?: ResponseErrorInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
37
70
  export function dns (opts?: DNSInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
38
71
  export function cache (opts?: CacheInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
72
+ export function deduplicate (opts?: DeduplicateInterceptorOpts): Dispatcher.DispatcherComposeInterceptor
39
73
  }
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "undici-types",
3
- "version": "7.16.0",
3
+ "version": "7.18.2",
4
4
  "description": "A stand-alone types package for Undici",
5
5
  "homepage": "https://undici.nodejs.org",
6
6
  "bugs": {
@@ -1,6 +1,6 @@
1
1
  import Client from './client'
2
2
  import TPoolStats from './pool-stats'
3
- import { URL } from 'url'
3
+ import { URL } from 'node:url'
4
4
  import Dispatcher from './dispatcher'
5
5
 
6
6
  export default Pool
@@ -1,5 +1,5 @@
1
- import { Readable } from 'stream'
2
- import { Blob } from 'buffer'
1
+ import { Readable } from 'node:stream'
2
+ import { Blob } from 'node:buffer'
3
3
 
4
4
  export default BodyReadable
5
5
 
@@ -0,0 +1,41 @@
1
+ import Client from './client'
2
+ import TPoolStats from './pool-stats'
3
+ import { URL } from 'node:url'
4
+ import Dispatcher from './dispatcher'
5
+
6
+ export default RoundRobinPool
7
+
8
+ type RoundRobinPoolConnectOptions = Omit<Dispatcher.ConnectOptions, 'origin'>
9
+
10
+ declare class RoundRobinPool extends Dispatcher {
11
+ constructor (url: string | URL, options?: RoundRobinPool.Options)
12
+ /** `true` after `pool.close()` has been called. */
13
+ closed: boolean
14
+ /** `true` after `pool.destroyed()` has been called or `pool.close()` has been called and the pool shutdown has completed. */
15
+ destroyed: boolean
16
+ /** Aggregate stats for a RoundRobinPool. */
17
+ readonly stats: TPoolStats
18
+
19
+ // Override dispatcher APIs.
20
+ override connect (
21
+ options: RoundRobinPoolConnectOptions
22
+ ): Promise<Dispatcher.ConnectData>
23
+ override connect (
24
+ options: RoundRobinPoolConnectOptions,
25
+ callback: (err: Error | null, data: Dispatcher.ConnectData) => void
26
+ ): void
27
+ }
28
+
29
+ declare namespace RoundRobinPool {
30
+ export type RoundRobinPoolStats = TPoolStats
31
+ export interface Options extends Client.Options {
32
+ /** Default: `(origin, opts) => new Client(origin, opts)`. */
33
+ factory?(origin: URL, opts: object): Dispatcher;
34
+ /** The max number of clients to create. `null` if no limit. Default `null`. */
35
+ connections?: number | null;
36
+ /** The amount of time before a client is removed from the pool and closed. `null` if no time limit. Default `null` */
37
+ clientTtl?: number | null;
38
+
39
+ interceptors?: { RoundRobinPool?: readonly Dispatcher.DispatchInterceptor[] } & Client.Options['interceptors']
40
+ }
41
+ }
@@ -1,8 +1,8 @@
1
1
  /// <reference types="node" />
2
2
 
3
- import type { Blob } from 'buffer'
4
- import type { ReadableStream, WritableStream } from 'stream/web'
5
- import type { MessagePort } from 'worker_threads'
3
+ import type { Blob } from 'node:buffer'
4
+ import type { ReadableStream, WritableStream } from 'node:stream/web'
5
+ import type { MessagePort } from 'node:worker_threads'
6
6
  import {
7
7
  EventInit,
8
8
  EventListenerOptions,
@@ -96,16 +96,16 @@ interface MessageEventInit<T = any> extends EventInit {
96
96
  data?: T
97
97
  lastEventId?: string
98
98
  origin?: string
99
- ports?: (typeof MessagePort)[]
100
- source?: typeof MessagePort | null
99
+ ports?: MessagePort[]
100
+ source?: MessagePort | null
101
101
  }
102
102
 
103
103
  interface MessageEvent<T = any> extends Event {
104
104
  readonly data: T
105
105
  readonly lastEventId: string
106
106
  readonly origin: string
107
- readonly ports: ReadonlyArray<typeof MessagePort>
108
- readonly source: typeof MessagePort | null
107
+ readonly ports: readonly MessagePort[]
108
+ readonly source: MessagePort | null
109
109
  initMessageEvent(
110
110
  type: string,
111
111
  bubbles?: boolean,
@@ -113,8 +113,8 @@ interface MessageEvent<T = any> extends Event {
113
113
  data?: any,
114
114
  origin?: string,
115
115
  lastEventId?: string,
116
- source?: typeof MessagePort | null,
117
- ports?: (typeof MessagePort)[]
116
+ source?: MessagePort | null,
117
+ ports?: MessagePort[]
118
118
  ): void;
119
119
  }
120
120
 
@@ -1,3 +1,7 @@
1
+ ## **6.15.0**
2
+ - [New] `parse`: add `strictMerge` option to wrap object/primitive conflicts in an array (#425, #122)
3
+ - [Fix] `duplicates` option should not apply to bracket notation keys (#514)
4
+
1
5
  ## **6.14.2**
2
6
  - [Fix] `parse`: mark overflow objects for indexed notation exceeding `arrayLimit` (#546)
3
7
  - [Fix] `arrayLimit` means max count, not max index, in `combine`/`merge`/`parseArrayValue`
@@ -30,6 +34,17 @@
30
34
  - [Dev Deps] update `es-value-fixtures`, `has-bigints`, `has-proto`, `has-symbols`
31
35
  - [Tests] increase coverage
32
36
 
37
+ ## **6.13.3**
38
+ [Fix] fix regressions from robustness refactor
39
+ [actions] update reusable workflows
40
+
41
+ ## **6.13.2**
42
+ - [Robustness] avoid `.push`, use `void`
43
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
44
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
45
+ - [readme] replace runkit CI badge with shields.io check-runs badge
46
+ - [actions] fix rebase workflow permissions
47
+
33
48
  ## **6.13.1**
34
49
  - [Fix] `stringify`: avoid a crash when a `filter` key is `null`
35
50
  - [Fix] `utils.merge`: functions should not be stringified into keys
@@ -46,6 +61,17 @@
46
61
  - [New] `parse`: add `strictDepth` option (#511)
47
62
  - [Tests] use `npm audit` instead of `aud`
48
63
 
64
+ ## **6.12.5**
65
+ - [Fix] fix regressions from robustness refactor
66
+ - [actions] update reusable workflows
67
+
68
+ ## **6.12.4**
69
+ - [Robustness] avoid `.push`, use `void`
70
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
71
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
72
+ - [readme] replace runkit CI badge with shields.io check-runs badge
73
+ - [actions] fix rebase workflow permissions
74
+
49
75
  ## **6.12.3**
50
76
  - [Fix] `parse`: properly account for `strictNullHandling` when `allowEmptyArrays`
51
77
  - [meta] fix changelog indentation
@@ -83,6 +109,17 @@
83
109
  - [Dev Deps] pin `glob`, since v10.3.8+ requires a broken `jackspeak`
84
110
  - [Dev Deps] pin `jackspeak` since 2.1.2+ depends on npm aliases, which kill the install process in npm < 6
85
111
 
112
+ ## **6.11.4**
113
+ - [Fix] fix regressions from robustness refactor
114
+ - [actions] update reusable workflows
115
+
116
+ ## **6.11.3**
117
+ - [Robustness] avoid `.push`, use `void`
118
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
119
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
120
+ - [readme] replace runkit CI badge with shields.io check-runs badge
121
+ - [actions] fix rebase workflow permissions
122
+
86
123
  ## **6.11.2**
87
124
  - [Fix] `parse`: Fix parsing when the global Object prototype is frozen (#473)
88
125
  - [Tests] add passing test cases with empty keys (#473)
@@ -100,6 +137,17 @@
100
137
  - [New] [Fix] `stringify`: revert 0e903c0; add `commaRoundTrip` option (#442)
101
138
  - [readme] fix version badge
102
139
 
140
+ ## **6.10.7**
141
+ - [Fix] fix regressions from robustness refactor
142
+ - [actions] update reusable workflows
143
+
144
+ ## **6.10.6**
145
+ - [Robustness] avoid `.push`, use `void`
146
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
147
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
148
+ - [readme] replace runkit CI badge with shields.io check-runs badge
149
+ - [actions] fix rebase workflow permissions
150
+
103
151
  ## **6.10.5**
104
152
  - [Fix] `stringify`: with `arrayFormat: comma`, properly include an explicit `[]` on a single-item array (#434)
105
153
 
@@ -137,6 +185,18 @@
137
185
  - [Tests] use `ljharb/actions/node/install` instead of `ljharb/actions/node/run`
138
186
  - [Tests] Revert "[meta] ignore eclint transitive audit warning"
139
187
 
188
+ ## **6.9.9**
189
+ - [Fix] fix regressions from robustness refactor
190
+ - [meta] add `npmignore` to autogenerate an npmignore file
191
+ - [actions] update reusable workflows
192
+
193
+ ## **6.9.8**
194
+ - [Robustness] avoid `.push`, use `void`
195
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
196
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
197
+ - [readme] replace runkit CI badge with shields.io check-runs badge
198
+ - [actions] fix rebase workflow permissions
199
+
140
200
  ## **6.9.7**
141
201
  - [Fix] `parse`: ignore `__proto__` keys (#428)
142
202
  - [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424)
@@ -197,6 +257,18 @@
197
257
  - [Tests] up to `node` `v12.10`, `v11.15`, `v10.16`, `v8.16`
198
258
  - [Tests] `Buffer.from` in node v5.0-v5.9 and v4.0-v4.4 requires a TypedArray
199
259
 
260
+ ## **6.8.5**
261
+ - [Fix] fix regressions from robustness refactor
262
+ - [meta] add `npmignore` to autogenerate an npmignore file
263
+ - [actions] update reusable workflows
264
+
265
+ ## **6.8.4**
266
+ - [Robustness] avoid `.push`, use `void`
267
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
268
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
269
+ - [readme] replace runkit CI badge with shields.io check-runs badge
270
+ - [actions] fix rebase workflow permissions
271
+
200
272
  ## **6.8.3**
201
273
  - [Fix] `parse`: ignore `__proto__` keys (#428)
202
274
  - [Robustness] `stringify`: avoid relying on a global `undefined` (#427)
@@ -241,6 +313,18 @@
241
313
  - [meta] add FUNDING.yml
242
314
  - [meta] Clean up license text so it’s properly detected as BSD-3-Clause
243
315
 
316
+ ## **6.7.5**
317
+ - [Fix] fix regressions from robustness refactor
318
+ - [meta] add `npmignore` to autogenerate an npmignore file
319
+ - [actions] update reusable workflows
320
+
321
+ ## **6.7.4**
322
+ - [Robustness] avoid `.push`, use `void`
323
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
324
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
325
+ - [readme] replace runkit CI badge with shields.io check-runs badge
326
+ - [actions] fix rebase workflow permissions
327
+
244
328
  ## **6.7.3**
245
329
  - [Fix] `parse`: ignore `__proto__` keys (#428)
246
330
  - [Fix] `stringify`: avoid encoding arrayformat comma when `encodeValuesOnly = true` (#424)
@@ -292,6 +376,18 @@
292
376
  - [Tests] fix Buffer tests to work in node < 4.5 and node < 5.10
293
377
  - [Tests] temporarily allow coverage to fail
294
378
 
379
+ ## **6.6.3**
380
+ - [Fix] fix regressions from robustness refactor
381
+ - [meta] add `npmignore` to autogenerate an npmignore file
382
+ - [actions] update reusable workflows
383
+
384
+ ## **6.6.2**
385
+ - [Robustness] avoid `.push`, use `void`
386
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
387
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
388
+ - [readme] replace runkit CI badge with shields.io check-runs badge
389
+ - [actions] fix rebase workflow permissions
390
+
295
391
  ## **6.6.1**
296
392
  - [Fix] `parse`: ignore `__proto__` keys (#428)
297
393
  - [Fix] fix for an impossible situation: when the formatter is called with a non-string value
@@ -334,6 +430,18 @@
334
430
  - [Dev Deps] update `browserify`, `eslint`, `@ljharb/eslint-config`, `iconv-lite`, `safe-publish-latest`, `tape`
335
431
  - [Tests] up to `node` `v10.10`, `v9.11`, `v8.12`, `v6.14`, `v4.9`; pin included builds to LTS
336
432
 
433
+ ## **6.5.5**
434
+ - [Fix] fix regressions from robustness refactor
435
+ - [meta] add `npmignore` to autogenerate an npmignore file
436
+ - [actions] update reusable workflows
437
+
438
+ ## **6.5.4**
439
+ - [Robustness] avoid `.push`, use `void`
440
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
441
+ - [readme] document that `addQueryPrefix` does not add `?` to empty output (#418)
442
+ - [readme] replace runkit CI badge with shields.io check-runs badge
443
+ - [actions] fix rebase workflow permissions
444
+
337
445
  ## **6.5.3**
338
446
  - [Fix] `parse`: ignore `__proto__` keys (#428)
339
447
  - [Fix] `utils.merge`: avoid a crash with a null target and a truthy non-array source
@@ -384,6 +492,18 @@
384
492
  - [Tests] up to `node` `v8.1`, `v7.10`, `v6.11`; npm v4.6 breaks on node < v1; npm v5+ breaks on node < v4
385
493
  - [Tests] add `editorconfig-tools`
386
494
 
495
+ ## **6.4.3**
496
+ - [Fix] fix regressions from robustness refactor
497
+ - [meta] add `npmignore` to autogenerate an npmignore file
498
+ - [actions] update reusable workflows
499
+
500
+ ## **6.4.2**
501
+ - [Robustness] avoid `.push`, use `void`
502
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
503
+ - [readme] replace runkit CI badge with shields.io check-runs badge
504
+ - [readme] replace travis CI badge with shields.io check-runs badge
505
+ - [actions] fix rebase workflow permissions
506
+
387
507
  ## **6.4.1**
388
508
  - [Fix] `parse`: ignore `__proto__` keys (#428)
389
509
  - [Fix] fix for an impossible situation: when the formatter is called with a non-string value
@@ -414,6 +534,17 @@
414
534
  - [Tests] up to `node` `v7.7`, `v6.10`,` v4.8`; disable osx builds since they block linux builds
415
535
  - [eslint] reduce warnings
416
536
 
537
+ ## **6.3.5**
538
+ - [Fix] fix regressions from robustness refactor
539
+ - [meta] add `npmignore` to autogenerate an npmignore file
540
+ - [actions] update reusable workflows
541
+
542
+ ## **6.3.4**
543
+ - [Robustness] avoid `.push`, use `void`
544
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
545
+ - [readme] replace travis CI badge with shields.io check-runs badge
546
+ - [actions] fix rebase workflow permissions
547
+
417
548
  ## **6.3.3**
418
549
  - [Fix] `parse`: ignore `__proto__` keys (#428)
419
550
  - [Fix] fix for an impossible situation: when the formatter is called with a non-string value
@@ -467,6 +598,17 @@
467
598
  - [Tests] skip Object.create tests when null objects are not available
468
599
  - [Tests] Turn on eslint for test files (#175)
469
600
 
601
+ ## **6.2.6**
602
+ - [Fix] fix regression from robustness refactor
603
+ - [meta] add `npmignore` to autogenerate an npmignore file
604
+ - [actions] update reusable workflows
605
+
606
+ ## **6.2.5**
607
+ - [Robustness] avoid `.push`, use `void`
608
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
609
+ - [readme] replace travis CI badge with shields.io check-runs badge
610
+ - [actions] fix rebase workflow permissions
611
+
470
612
  ## **6.2.4**
471
613
  - [Fix] `parse`: ignore `__proto__` keys (#428)
472
614
  - [Fix] `utils.merge`: avoid a crash with a null target and an array source
@@ -505,6 +647,16 @@
505
647
  - [New] add "encoder" and "decoder" options, for custom param encoding/decoding (#160)
506
648
  - [Fix] fix compacting of nested sparse arrays (#150)
507
649
 
650
+ ## **6.1.4**
651
+ - [Fix] fix regression from robustness refactor
652
+ - [meta] add `npmignore` to autogenerate an npmignore file
653
+ - [actions] update reusable workflows
654
+
655
+ ## **6.1.3**
656
+ - [Robustness] avoid `.push`, use `void`
657
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
658
+ - [readme] replace travis CI badge with shields.io check-runs badge
659
+
508
660
  ## **6.1.2**
509
661
  - [Fix] follow `allowPrototypes` option during merge (#201, #200)
510
662
  - [Fix] chmod a-x
@@ -519,6 +671,16 @@
519
671
  - [Fix] "sort" option should work at a depth of 3 or more (#151)
520
672
  - [Fix] Restore `dist` directory; will be removed in v7 (#148)
521
673
 
674
+ ## **6.0.6**
675
+ - [Fix] fix regression from robustness refactor
676
+ - [meta] add `npmignore` to autogenerate an npmignore file
677
+ - [actions] update reusable workflows
678
+
679
+ ## **6.0.5**
680
+ - [Robustness] avoid `.push`, use `void`
681
+ - [readme] clarify `parseArrays` and `arrayLimit` documentation (#543)
682
+ - [readme] replace travis CI badge with shields.io check-runs badge
683
+
522
684
  ## **6.0.4**
523
685
  - [Fix] follow `allowPrototypes` option during merge (#201, #200)
524
686
  - [Fix] chmod a-x
@@ -197,6 +197,11 @@ assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'first' }), { foo: 'b
197
197
  assert.deepEqual(qs.parse('foo=bar&foo=baz', { duplicates: 'last' }), { foo: 'baz' });
198
198
  ```
199
199
 
200
+ Note that keys with bracket notation (`[]`) always combine into arrays, regardless of the `duplicates` setting:
201
+ ```javascript
202
+ assert.deepEqual(qs.parse('a=1&a=2&b[]=1&b[]=2', { duplicates: 'last' }), { a: '2', b: ['1', '2'] });
203
+ ```
204
+
200
205
  If you have to deal with legacy browsers or services, there's also support for decoding percent-encoded octets as iso-8859-1:
201
206
 
202
207
  ```javascript
@@ -325,6 +330,19 @@ var mixedNotation = qs.parse('a[0]=b&a[b]=c');
325
330
  assert.deepEqual(mixedNotation, { a: { '0': 'b', b: 'c' } });
326
331
  ```
327
332
 
333
+ When a key appears as both a plain value and an object, **qs** will by default wrap the conflicting values in an array (`strictMerge` defaults to `true`):
334
+
335
+ ```javascript
336
+ assert.deepEqual(qs.parse('a[b]=c&a=d'), { a: [{ b: 'c' }, 'd'] });
337
+ assert.deepEqual(qs.parse('a=d&a[b]=c'), { a: ['d', { b: 'c' }] });
338
+ ```
339
+
340
+ To restore the legacy behavior (where the primitive is used as a key with value `true`), set `strictMerge` to `false`:
341
+
342
+ ```javascript
343
+ assert.deepEqual(qs.parse('a[b]=c&a=d', { strictMerge: false }), { a: { b: 'c', d: true } });
344
+ ```
345
+
328
346
  You can also create arrays of objects:
329
347
 
330
348
  ```javascript