-
-
Notifications
You must be signed in to change notification settings - Fork 112
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
It's possible to get a node without a range after successfully parsing a document with a map inside a collection #573
Labels
bug
Something isn't working
Comments
Thank you for noticing and reporting this! There was a missing assignment of the range for the map for flow sequence pairs. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Describe the bug
Sorry for the long winded title, but it's a bit hard to describe! I've found a case that parses successfully, but contains a YAMLMap node that does not have a range. This violates the TypeScript type definitions exposed by this library, although I'm fairly certain the issue is not with the type definitions, but with the parsing itself.
To Reproduce
According to TypeScript,
range
should never be null/undefined in this example, but it is in fact undefined.Expected behaviour
Either
parseDocument
should fail because this is not compliant YAML, orfirstItem
should have a range, or the TypeScript types should correctly identify that range is optional onfirstItem
.Versions (please complete the following information):
yaml
: 2.5.0Additional context
Incidentally, the following does include a range when parsed:
[{a:}]
.The text was updated successfully, but these errors were encountered: