Skip to content

Commit 471e571

Browse files
feat: Replace query-string with qs@6-compatible bracket-notation parser (#3662)
1 parent 54497e1 commit 471e571

10 files changed

Lines changed: 781 additions & 242 deletions

File tree

package-lock.json

Lines changed: 0 additions & 131 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

packages/feathers/fixtures/client.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,9 @@ export function clientTests(app: any, name: string) {
2121
it('.get and params passing', async () => {
2222
const query = {
2323
returnquery: 'true',
24-
some: ['thing', '2', 'test']
24+
some: 'thing',
25+
other: ['one', 'two'],
26+
nested: { a: { b: 'object' } }
2527
}
2628

2729
const todo = await getService().get('0', { query })

packages/feathers/package.json

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -90,9 +90,7 @@
9090
},
9191
"devDependencies": {
9292
"@types/node": "^24.1.0",
93-
"@types/qs": "^6.14.0",
9493
"@vitest/coverage-v8": "^3.2.4",
95-
"qs": "^6.15.0",
9694
"shx": "^0.4.0",
9795
"typescript": "^5.8.0",
9896
"vitest": "^3.2.4"

packages/feathers/src/client/fetch.test.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -54,6 +54,13 @@ describe('fetch REST connector', function () {
5454
await expect(() => service.get('notfound', {})).rejects.toBeInstanceOf(NotFound)
5555
})
5656

57+
it('supports nested arrays in queries', async () => {
58+
const query = { test: { $in: ['0', '1', '2'] }, returnquery: 'true' }
59+
const data = await service.get('dishes', { query })
60+
61+
expect(data.query).toEqual(query)
62+
})
63+
5764
it('can initialize a client instance', async () => {
5865
const init = fetchClient(fetch, {
5966
baseUrl: baseUrl

packages/feathers/src/client/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
import type { Application, Query } from '../declarations.js'
2-
import { stringify as defaultStringify } from '../query-string.js'
2+
import { stringify as defaultStringify } from '../qs.js'
33
import { FetchClient, ProxiedFetchClient } from './fetch.js'
44
import { sseClient, SseClientOptions } from './sse.js'
55
import { defaultServiceEvents } from '../service.js'

packages/feathers/src/http/middleware.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import type { Params, Service, Query } from '../index.js'
22
import type { HookContext, NextFunction } from '../hooks/index.js'
33
import { BadRequest, FeathersError } from '../errors.js'
4-
import { parse } from '../query-string.js'
4+
import { parse } from '../qs.js'
55

66
interface RouteLookup {
77
service: Service

0 commit comments

Comments
 (0)