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
Convert proposal-object-rest-spread to TS #13948
Conversation
Build successful! You can test your changes in the REPL here: https://babeljs.io/repl/build/49918/ |
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 28355c5:
|
const objectPatternPath = path.findParent(path => | ||
path.isObjectPattern(), | ||
//@ts-expect-error: findParent can not apply assertions on result shape | ||
const objectPatternPath: NodePath<t.ObjectPattern> = path.findParent( |
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.
Not in this PR, but maybe something like this would work:
function findParent<T extends t.Node>(test: (path: NodePath<t.Node>) => path is NodePath<T>): T | null;
8096f11
to
e4c6d09
Compare
e4c6d09
to
d7b4dee
Compare
d7b4dee
to
46869b0
Compare
Converted
proposal-object-rest-spread
to TS and fixed typing errors.