-
-
Notifications
You must be signed in to change notification settings - Fork 2
Add types #3
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
Add types #3
Conversation
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.
Thanks @guillaumegarcia13!
It would be good to have a type test for this, similar to https://github.com/stefanprobst/xast-util-sitemap/blob/2a1a85a33cbd5a565f4c7fef7f142160a596bd6d/types/test.ts which was added in syntax-tree/xast-util-sitemap#1
Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
Hi @ChristianMurphy! |
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.
Thanks for following up @guillaumegarcia13! Just a few more tweaks and this should be good to go!
Would it be possible to have type tests for this PR? |
Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
types/index.d.ts
Outdated
* @param options Whether to drop parent nodes if they had children, but all their children were filtered out. Default is {cascade: true} | ||
* @param test is-compatible test (such as a type) | ||
*/ | ||
export function remove<T extends Node>( |
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.
This function is exported using module.exports = remove
.
To reflect this correctly in the types, this should be exported using:
export = remove
Co-authored-by: Remco Haszing <remcohaszing@gmail.com>
Thanks all, released in 2.1.0! |
Thank you all for your patience and advice. 🙏🏻 |
[Typescript newbie here 👶🏻]
Not too sure about this one... 😬
Would happily be reviewed