Skip to content

Commit 0173f64

Browse files
authored
Merge branch 'main' into tsdoc
2 parents 2d4de88 + 1287b3e commit 0173f64

File tree

6 files changed

+19
-14
lines changed

6 files changed

+19
-14
lines changed

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,7 @@
7474
"devDependencies": {
7575
"@babel/preset-env": "^7.20.2",
7676
"@rollup/plugin-babel": "^6.0.3",
77-
"@rollup/plugin-commonjs": "23.0.3",
77+
"@rollup/plugin-commonjs": "23.0.4",
7878
"@rollup/plugin-json": "^5.0.2",
7979
"@rollup/plugin-node-resolve": "15.0.1",
8080
"@types/jest": "^27.5.0",

playgrounds/javascript/yarn.lock

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4145,9 +4145,9 @@ q@^1.1.2:
41454145
integrity sha1-fjL3W0E4EpHQRhHxvxQQmsAGUdc=
41464146

41474147
qs@~6.5.2:
4148-
version "6.5.2"
4149-
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36"
4150-
integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA==
4148+
version "6.5.3"
4149+
resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.3.tgz#3aeeffc91967ef6e35c0e488ef46fb296ab76aad"
4150+
integrity sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==
41514151

41524152
querystring-es3@^0.2.0:
41534153
version "0.2.1"

src/indexes.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ import { HttpRequests } from './http-requests'
4444
import { Task, TaskClient } from './task'
4545
import { EnqueuedTask } from './enqueued-task'
4646

47-
class Index<T = Record<string, any>> {
47+
class Index<T extends Record<string, any> = Record<string, any>> {
4848
uid: string
4949
primaryKey: string | undefined
5050
createdAt: Date | undefined
@@ -76,11 +76,11 @@ class Index<T = Record<string, any>> {
7676
* @param config - Additional request configuration options
7777
* @returns Promise containing the search response
7878
*/
79-
async search<T = Record<string, any>>(
79+
async search<D = T>(
8080
query?: string | null,
8181
options?: SearchParams,
8282
config?: Partial<Request>
83-
): Promise<SearchResponse<T>> {
83+
): Promise<SearchResponse<D>> {
8484
const url = `indexes/${this.uid}/search`
8585

8686
return await this.httpRequest.post(
@@ -99,11 +99,11 @@ class Index<T = Record<string, any>> {
9999
* @param config - Additional request configuration options
100100
* @returns Promise containing the search response
101101
*/
102-
async searchGet<T = Record<string, any>>(
102+
async searchGet<D = T>(
103103
query?: string | null,
104104
options?: SearchParams,
105105
config?: Partial<Request>
106-
): Promise<SearchResponse<T>> {
106+
): Promise<SearchResponse<D>> {
107107
const url = `indexes/${this.uid}/search`
108108

109109
const parseFilter = (filter?: Filter): string | undefined => {
@@ -126,7 +126,7 @@ class Index<T = Record<string, any>> {
126126
attributesToHighlight: options?.attributesToHighlight?.join(','),
127127
}
128128

129-
return await this.httpRequest.get<SearchResponse<T>>(
129+
return await this.httpRequest.get<SearchResponse<D>>(
130130
url,
131131
removeUndefinedFromObject(getParams),
132132
config

tests/env/typescript-node/src/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,9 @@ interface Movie {
1919
id: number
2020
title: string
2121
genre?: string
22+
comment?: string
23+
isNull?: null
24+
isTrue?: true
2225
}
2326

2427
const client = new MeiliSearch(config)

tests/typed_search.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,8 @@ interface Movie {
2121
title: string
2222
comment?: string
2323
genre?: string
24+
isNull?: null
25+
isTrue?: boolean
2426
}
2527

2628
interface NestedDocument {

yarn.lock

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1552,10 +1552,10 @@
15521552
"@babel/helper-module-imports" "^7.18.6"
15531553
"@rollup/pluginutils" "^5.0.1"
15541554

1555-
"@rollup/[email protected].3":
1556-
version "23.0.3"
1557-
resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-23.0.3.tgz#442cd8ccca1b7563a503da86fc84a1a7112b54bb"
1558-
integrity sha512-31HxrT5emGfTyIfAs1lDQHj6EfYxTXcwtX5pIIhq+B/xZBNIqQ179d/CkYxlpYmFCxT78AeU4M8aL8Iv/IBxFA==
1555+
"@rollup/[email protected].4":
1556+
version "23.0.4"
1557+
resolved "https://registry.yarnpkg.com/@rollup/plugin-commonjs/-/plugin-commonjs-23.0.4.tgz#854e9b1a83f0a715ded70a2ae411bebc11141de2"
1558+
integrity sha512-bOPJeTZg56D2MCm+TT4psP8e8Jmf1Jsi7pFUMl8BN5kOADNzofNHe47+84WVCt7D095xPghC235/YKuNDEhczg==
15591559
dependencies:
15601560
"@rollup/pluginutils" "^5.0.1"
15611561
commondir "^1.0.1"

0 commit comments

Comments
 (0)