Commit c12eb7dd authored by Robert Knight's avatar Robert Knight

Use type annotation instead of type assertion

This causes TS to check assignability rather than casting the type, which can
catch additional mistakes, such as mis-naming an optional property.
parent b426954f
......@@ -128,14 +128,14 @@ export class SearchClient extends TinyEmitter {
async _getPage(query: SearchQuery, searchAfter?: string, pageIndex = 0) {
const pageSize = this._getPageSize(pageIndex);
const searchQuery = {
const searchQuery: SearchQuery = {
limit: pageSize,
sort: this._sortBy,
order: this._sortOrder,
_separate_replies: this._separateReplies,
...query,
} as SearchQuery;
};
if (searchAfter) {
searchQuery.search_after = searchAfter;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment