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

Remove obsolete type guards and fix axes attribute creation #379

Merged
merged 2 commits into from
Dec 11, 2020
Merged

Conversation

axelboc
Copy link
Contributor

@axelboc axelboc commented Dec 11, 2020

No description provided.

} & (
| { axes: T; axesAttr: (Extract<keyof T, string> | '.')[] }
| { axes?: never; axesAttr?: never }
) &
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Changing my mind on this. I think inlining is clearer after all. 🤷‍♂️

The change below also required a slight change in typing: Extract<keyof T, string> instead of keyof T, as keyof T resolves to string | number | Symbol as explained in microsoft/TypeScript#23724 (comment) ... even though T is Record<string, ...>! This seems very odd... there's a comment about it in the linked PR, but no answer.

Copy link
Member

Choose a reason for hiding this comment

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

Probably keyof does not behave well with templates ? 🤷

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Generics you mean? The guy's comment on microsoft/TypeScript#23724 (comment) doesn't mention a generic so I don't think it's related.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

src/h5web/providers/my-utils.ts Show resolved Hide resolved
src/h5web/providers/utils.ts Show resolved Hide resolved
@axelboc axelboc requested a review from loichuder December 11, 2020 09:13
src/h5web/providers/my-utils.ts Show resolved Hide resolved
@axelboc axelboc merged commit 1b9e0ae into master Dec 11, 2020
@axelboc axelboc deleted the clean-up branch December 11, 2020 09:37
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