-
-
Notifications
You must be signed in to change notification settings - Fork 108
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
Fix Parser and Compiler types #64
Conversation
This comment has been minimized.
This comment has been minimized.
/cc @Rokt33r |
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 |
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!
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 <tituswormer@gmail.com> Reviewed-by: Junyoung Choi <fluke8259@gmail.com> Reviewed-by: Christian Murphy <christian.murphy.42@gmail.com> Co-authored-by: Junyoung Choi <fluke8259@gmail.com> Co-authored-by: Christian Murphy <christian.murphy.42@gmail.com>
The current typings are defined such that Parsers and Compilers (and their respective functional variants) take
VFileCompatible
arguments (and, in the case of Parsers, has the wrong number of arguments). The truth is the spec states that they should acceptVFile
objects (and Parsers take two arguments), and the underlying implementation aligns with this:vfile()
'd argumentvfile()
'd argumentfile
passed to both isvfile(doc)
in both.index.js
.Looking for the same inconsistency in the typings, I checked other occurrences of
VFileCompatible
in theindex.d.ts
file. The remaining occurrences align with the spec--that is, anywhereVFileCompatible
shows up in the typings, the spec explicitly states "any value accepted byvfile()
".