Skip to content

Commit 59777c5

Browse files
committed
lint fix
1 parent 6294628 commit 59777c5

File tree

1 file changed

+36
-36
lines changed

1 file changed

+36
-36
lines changed

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

Lines changed: 36 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -18,39 +18,39 @@ interface Movie {
1818
genre?: string
1919
}
2020

21-
const client = new MeiliSearch(config)
22-
23-
; (async () => {
24-
const index = await client.getOrCreateIndex<Movie>('movies')
25-
26-
const indexes = await client.getIndexes()
27-
indexes.map((index: IndexResponse) => {
28-
console.log(index.uid)
29-
// console.log(index.something) -> ERROR
30-
})
31-
32-
const searchParams: SearchParams = {
33-
limit: 5,
34-
attributesToRetrieve: ['title', 'genre'],
35-
attributesToHighlight: ['title'],
36-
// test: true -> ERROR Test does not exist on type SearchParams
37-
}
38-
indexes.map((index: IndexResponse) => index.uid)
39-
const res: SearchResponse<Movie> = await index.search(
40-
'avenger',
41-
searchParams
42-
)
43-
44-
// both work
45-
const { hits }: { hits: Hits<Movie> } = res
46-
47-
hits.map((hit: Hit<Movie>) => {
48-
console.log(hit?.genre)
49-
console.log(hit.title)
50-
// console.log(hit._formatted.title) -> ERROR, _formatted could be undefined
51-
// console.log(hit?._formatted.title) -> ERROR, title could be undefined
52-
console.log(hit?._formatted?.title)
53-
})
54-
55-
await index.delete()
56-
})()
21+
const client = new MeiliSearch(config);
22+
23+
(async () => {
24+
const index = await client.getOrCreateIndex<Movie>('movies')
25+
26+
const indexes = await client.getIndexes()
27+
indexes.map((index: IndexResponse) => {
28+
console.log(index.uid)
29+
// console.log(index.something) -> ERROR
30+
})
31+
32+
const searchParams: SearchParams = {
33+
limit: 5,
34+
attributesToRetrieve: ['title', 'genre'],
35+
attributesToHighlight: ['title'],
36+
// test: true -> ERROR Test does not exist on type SearchParams
37+
}
38+
indexes.map((index: IndexResponse) => index.uid)
39+
const res: SearchResponse<Movie> = await index.search(
40+
'avenger',
41+
searchParams
42+
)
43+
44+
// both work
45+
const { hits }: { hits: Hits<Movie> } = res
46+
47+
hits.map((hit: Hit<Movie>) => {
48+
console.log(hit?.genre)
49+
console.log(hit.title)
50+
// console.log(hit._formatted.title) -> ERROR, _formatted could be undefined
51+
// console.log(hit?._formatted.title) -> ERROR, title could be undefined
52+
console.log(hit?._formatted?.title)
53+
})
54+
55+
await index.delete()
56+
})()

0 commit comments

Comments
 (0)