Skip to content
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

fix(NODE-3386): listCollections result type definition #2866

Merged
merged 4 commits into from Jul 9, 2021

Conversation

nbbeeken
Copy link
Contributor

The listCollections cursor now has a generic that defaults to a flexible CollectionInfo type. Typescript can't change a return type bases on a runtime boolean so I show example usage in the added types test of how one can use the API pretty succinctly.

@addaleax
Copy link
Contributor

Typescript can't change a return type bases on a runtime boolean

Fwiw, it can come pretty close: TypeScript playground

@nbbeeken
Copy link
Contributor Author

Oo thanks for the insight, I'll give that a try

@emadum emadum self-requested a review July 2, 2021 15:10
@emadum emadum added the Primary Review In Review with primary reviewer, not yet ready for team's eyes label Jul 2, 2021
Copy link
Contributor

@emadum emadum left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍

@emadum emadum added Team Review Needs review from team and removed Primary Review In Review with primary reviewer, not yet ready for team's eyes labels Jul 2, 2021
@emadum emadum requested a review from durran July 2, 2021 16:01
@nbbeeken nbbeeken removed the request for review from durran July 8, 2021 15:05
@emadum emadum requested a review from dariakp July 8, 2021 15:38
Copy link
Contributor

@dariakp dariakp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

small typo, otherwise LGTM :)

test/types/list_collections.test-d.ts Outdated Show resolved Hide resolved
@nbbeeken nbbeeken requested a review from dariakp July 8, 2021 19:18
@nbbeeken nbbeeken force-pushed the NODE-3386/listCollectionsTypes branch from d008033 to b7c35cb Compare July 9, 2021 16:24
@nbbeeken
Copy link
Contributor Author

nbbeeken commented Jul 9, 2021

Rebased, should clear up the unrelated error in the last CI run

@emadum emadum merged commit c12979a into 4.0 Jul 9, 2021
@emadum emadum deleted the NODE-3386/listCollectionsTypes branch July 9, 2021 17:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team Review Needs review from team
Projects
None yet
4 participants