Skip to content

Remove unnecessary type assertion in getProfileAll#1530

Merged
NSeydoux merged 2 commits intomainfrom
chore/webid-no-type-assertion
Mar 23, 2022
Merged

Remove unnecessary type assertion in getProfileAll#1530
NSeydoux merged 2 commits intomainfrom
chore/webid-no-type-assertion

Conversation

@NSeydoux
Copy link
Copy Markdown
Contributor

This introduces an overload to cleanly define the return type of getProfileAll, namely it the WebID profile is NOT provided, the return type includes that of getSolidDataset, and if it IS provided then the return type includes the generics instanciated by the provided WebID profile. Making this distinction allows to remove a type assertion from the implementation.

@NSeydoux NSeydoux requested a review from a team as a code owner March 21, 2022 15:07
@codesandbox-ci
Copy link
Copy Markdown

codesandbox-ci Bot commented Mar 21, 2022

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit 6b9c891:

Sandbox Source
solid-client-sandbox Configuration

@NSeydoux NSeydoux temporarily deployed to Inrupt Production March 21, 2022 15:31 Inactive
Copy link
Copy Markdown
Contributor

@ThisIsMissEm ThisIsMissEm left a comment

Choose a reason for hiding this comment

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

LGTM, but do double check how this looks in the documentation, as to whether it's clear there.

@NSeydoux NSeydoux force-pushed the chore/webid-no-type-assertion branch from 971b747 to a84a616 Compare March 22, 2022 15:29
@NSeydoux NSeydoux temporarily deployed to Inrupt Production March 22, 2022 15:30 Inactive
@NSeydoux NSeydoux temporarily deployed to Inrupt Dev-Next March 22, 2022 15:30 Inactive
@NSeydoux NSeydoux temporarily deployed to Inrupt 1.1 March 22, 2022 15:30 Inactive
@vercel vercel Bot temporarily deployed to Preview March 22, 2022 15:30 Inactive
@NSeydoux NSeydoux force-pushed the chore/webid-no-type-assertion branch from a84a616 to 34bd132 Compare March 22, 2022 15:32
@NSeydoux NSeydoux temporarily deployed to Inrupt Production March 22, 2022 15:32 Inactive
@NSeydoux NSeydoux temporarily deployed to Inrupt Dev-Next March 22, 2022 15:32 Inactive
@NSeydoux NSeydoux temporarily deployed to Inrupt 1.1 March 22, 2022 15:32 Inactive
@vercel vercel Bot temporarily deployed to Preview March 22, 2022 15:32 Inactive
@NSeydoux NSeydoux temporarily deployed to NSS March 22, 2022 15:32 Inactive
@github-actions github-actions Bot requested a deployment to review March 22, 2022 15:36 Abandoned
This introduces an overload to cleanly define the return type of getProfileAll, namely it the WebID profile is NOT provided, the return type includes that of `getSolidDataset`, and if it IS provided then the return type includes the generics instanciated by the provided WebID profile. Making this distinction allows to remove a type assertion from the implementation.
@NSeydoux NSeydoux force-pushed the chore/webid-no-type-assertion branch from 34bd132 to 56dc2c6 Compare March 22, 2022 15:40
@NSeydoux NSeydoux temporarily deployed to Inrupt Production March 22, 2022 15:40 Inactive
@NSeydoux NSeydoux temporarily deployed to Inrupt Dev-Next March 22, 2022 15:40 Inactive
@NSeydoux NSeydoux temporarily deployed to Inrupt 1.1 March 22, 2022 15:40 Inactive
@vercel vercel Bot temporarily deployed to Preview March 22, 2022 15:40 Inactive
@NSeydoux NSeydoux temporarily deployed to NSS March 22, 2022 15:40 Inactive
@NSeydoux
Copy link
Copy Markdown
Contributor Author

Not too bad actually: https://solid-client-js-ni3xdinux-inrupt.vercel.app/modules/profile_webid.html ! I just removed the type parameter from the overload where it isn't necessary.

@NSeydoux NSeydoux enabled auto-merge (squash) March 22, 2022 15:43
@github-actions github-actions Bot requested a deployment to review March 22, 2022 15:44 Abandoned
@NSeydoux NSeydoux temporarily deployed to Inrupt Production March 23, 2022 08:07 Inactive
@NSeydoux NSeydoux temporarily deployed to Inrupt Dev-Next March 23, 2022 08:07 Inactive
@NSeydoux NSeydoux temporarily deployed to Inrupt 1.1 March 23, 2022 08:07 Inactive
@NSeydoux NSeydoux temporarily deployed to NSS March 23, 2022 08:07 Inactive
@vercel vercel Bot temporarily deployed to Preview March 23, 2022 08:07 Inactive
@NSeydoux NSeydoux temporarily deployed to Inrupt Production March 23, 2022 08:14 Inactive
@NSeydoux NSeydoux merged commit f5e30f5 into main Mar 23, 2022
@NSeydoux NSeydoux deleted the chore/webid-no-type-assertion branch March 23, 2022 08:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants