-
-
Notifications
You must be signed in to change notification settings - Fork 298
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Typed hits property in search method #21
Conversation
@@ -129,7 +135,7 @@ export class Lyra<TSchema extends PropertiesSchema = PropertiesSchema> { | |||
break; | |||
} | |||
|
|||
const fullDoc = this.docs.get(id); | |||
const fullDoc = this.docs.get(id)!; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@micheleriva Is there a better way to do that? I hate asserting non-null
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
mmm afaik this is the only way... if there's a guarantee that the value exists, it's not that bad
This PR aims to avoid the assertion of a type when handling the result object.