-
-
Notifications
You must be signed in to change notification settings - Fork 121
Fix Parser and Compiler types #64
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
Conversation
This comment has been minimized.
This comment has been minimized.
|
/cc @Rokt33r |
ChristianMurphy
left a comment
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 @clavin!
A couple questions on the changes below.
|
Oh! 😳Nice catch on the object methods. Those should be patched up 👍 I also noticed that the |
ChristianMurphy
left a comment
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.
LGTM, thanks @clavin!
Rokt33r
left a comment
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.
LGTM! 👍 👍
|
@wooorm these are fixes and can go in a patch release. |
Related to unifiedjs/unified#53. Related to unifiedjs/unified#54. Related to unifiedjs/unified#56. Related to unifiedjs/unified#57. Related to unifiedjs/unified#58. Related to unifiedjs/unified#59. Related to unifiedjs/unified#60. Related to unifiedjs/unified#61. Related to unifiedjs/unified#62. Related to unifiedjs/unified#63. Related to unifiedjs/unified#64. Related to #426. Reviewed-by: Titus Wormer <[email protected]> Reviewed-by: Junyoung Choi <[email protected]> Reviewed-by: Christian Murphy <[email protected]> Co-authored-by: Junyoung Choi <[email protected]> Co-authored-by: Christian Murphy <[email protected]>
The current typings are defined such that Parsers and Compilers (and their respective functional variants) take
VFileCompatiblearguments (and, in the case of Parsers, has the wrong number of arguments). The truth is the spec states that they should acceptVFileobjects (and Parsers take two arguments), and the underlying implementation aligns with this:vfile()'d argumentvfile()'d argumentfilepassed to both isvfile(doc)in both.index.js.Looking for the same inconsistency in the typings, I checked other occurrences of
VFileCompatiblein theindex.d.tsfile. The remaining occurrences align with the spec--that is, anywhereVFileCompatibleshows up in the typings, the spec explicitly states "any value accepted byvfile()".