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

Move custom Object.keys() overload to util #2020

Merged
merged 1 commit into from
Nov 11, 2023
Merged

Conversation

auscompgeek
Copy link
Member

Closes #2018

Checklist

  • I have not broken the cheatsheet

@@ -52,7 +52,7 @@ export function getNodeMatcher(

export const languageMatchers: Record<
LegacyLanguageId,
Record<SimpleScopeTypeType, NodeMatcher>
Partial<Record<SimpleScopeTypeType, NodeMatcher>>
Copy link
Member Author

Choose a reason for hiding this comment

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

See change in nodeMatchers.ts

}
});
return nodeMatchers as Record<SimpleScopeTypeType, NodeMatcher>;
): Partial<Record<SimpleScopeTypeType, NodeMatcher>> {
Copy link
Member Author

Choose a reason for hiding this comment

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

Whilst I was here, figured I might as well remove the type assertion by using fromEntries. Turns out we were lying to TypeScript here; no guarantees every SimpleScopeTypeType will exist here at the end.

@@ -159,7 +159,7 @@ async function runTest(file: string, spyIde: SpyIDE) {
? undefined
: marksToPlainObject(
extractTargetedMarks(
Object.keys(fixture.finalState.marks) as string[],
Object.keys(fixture.finalState.marks),
Copy link
Member Author

Choose a reason for hiding this comment

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

Looks like this custom typing was really getting in the way 😄

Copy link
Member

@pokey pokey left a comment

Choose a reason for hiding this comment

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

looks good!

@pokey pokey added this pull request to the merge queue Nov 11, 2023
Merged via the queue into main with commit 56b8431 Nov 11, 2023
13 checks passed
@pokey pokey deleted the remove-object-keys-type branch November 11, 2023 16:31
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.

Remove object.keys types
2 participants