-
Notifications
You must be signed in to change notification settings - Fork 301
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
feat: Allow boolean returnMetadata for Vectorize V2 queries #2596
feat: Allow boolean returnMetadata for Vectorize V2 queries #2596
Conversation
): value is VectorizeMetadataRetrievalLevel { | ||
): boolean { |
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.
Is there a reason for this change? I think it makes sense to keep it as it was
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.
I changed this to get rid of a warning Invalid type "never" of template literal expression.eslint[@typescript-eslint/restrict-template-expressions](https://typescript-eslint.io/rules/restrict-template-expressions)
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.
You'll need to run prettier on vectorize-api.ts
3fbb9bf
to
fced277
Compare
); | ||
if (options && options.returnMetadata) { | ||
if ( | ||
typeof options.returnMetadata !== 'boolean' && |
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.
Maybe perform this type check once?
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.
How would you recommend this to be refactored?
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.
The checks could be made a bit more efficient but overall LGTM
Co-authored-by: James M Snell <jasnell@gmail.com>
Allow boolean returnMetadata for Vectorize V2 queries for backward compatibility with Vectorize V1.