You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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.
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, or firstItem should have a range, or the TypeScript types should correctly identify that range is optional on firstItem.
Versions (please complete the following information):
Environment: Node v22.6.0
yaml: 2.5.0
Additional context
Incidentally, the following does include a range when parsed: [{a:}].
The text was updated successfully, but these errors were encountered:
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: