-
-
Notifications
You must be signed in to change notification settings - Fork 85
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
Conversation
@@ -52,7 +52,7 @@ export function getNodeMatcher( | |||
|
|||
export const languageMatchers: Record< | |||
LegacyLanguageId, | |||
Record<SimpleScopeTypeType, NodeMatcher> | |||
Partial<Record<SimpleScopeTypeType, NodeMatcher>> |
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.
See change in nodeMatchers.ts
} | ||
}); | ||
return nodeMatchers as Record<SimpleScopeTypeType, NodeMatcher>; | ||
): Partial<Record<SimpleScopeTypeType, NodeMatcher>> { |
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.
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), |
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.
Looks like this custom typing was really getting in the way 😄
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.
looks good!
Closes #2018
Checklist