jsdoc-type-pratt-parser
Advanced tools
Changelog
4.0.0 (2023-03-15)
ObjectFieldResult
(20bf77d)ObjectResult
no longer contains KeyValueResult
, but uses the new types ObjectFieldResult
and JsdocObjectFieldResult
.For mode typescript
this basically means a simple rename of type JsdocTypeKeyValue
to JsdocTypeObjectField
:
input: { key: string }
before:
{
"type": "JsdocTypeObject",
"meta": {
"separator": "comma"
},
"elements": [
{
"type": "JsdocTypeKeyValue",
"key": "key",
"right": {
"type": "JsdocTypeName",
"value": "string"
},
"optional": false,
"readonly": false,
"variadic": false,
"meta": {
"hasLeftSideExpression": false
}
}
]
}
after:
{
"type": "JsdocTypeObject",
"meta": {
"separator": "comma"
},
"elements": [
{
"type": "JsdocTypeObjectField",
"key": "key",
"right": {
"type": "JsdocTypeName",
"value": "string"
},
"optional": false,
"readonly": false,
"variadic": false,
"meta": {
"quote": undefined
}
}
]
}
for jsdoc
mode the JsdocTypeKeyValue
can now be either JsdocTypeObjectField
or JsdocTypeJsdocObjectField
:
input: { Array<string>: string }
before:
{
"type": "JsdocTypeObject",
"meta": {
"separator": "comma"
},
"elements": [
{
"type": "JsdocTypeKeyValue",
"left": {
"type": "JsdocTypeGeneric",
"left": {
"type": "JsdocTypeName",
"value": "Array"
},
"elements": [
{
"type": "JsdocTypeName",
"value": "string"
}
],
"meta": {
"brackets": "angle",
"dot": false
}
},
"right": {
"type": "JsdocTypeName",
"value": "string"
},
"meta": {
"hasLeftSideExpression": true
}
}
]
}
after:
{
"type": "JsdocTypeObject",
"meta": {
"separator": "comma"
},
"elements": [
{
"type": "JsdocTypeJsdocObjectField",
"left": {
"type": "JsdocTypeGeneric",
"left": {
"type": "JsdocTypeName",
"value": "Array"
},
"elements": [
{
"type": "JsdocTypeName",
"value": "string"
}
],
"meta": {
"brackets": "angle",
"dot": false
}
},
"right": {
"type": "JsdocTypeName",
"value": "string"
}
}
]
}
Changelog
3.0.0 (2022-04-19)
token()
, peek()
and previous()
have been replaced with readonly properties current
, next
, previous
.lexer
.