Closed
Description
Describe the bug
In the Writing Custom Tags there is an example:
stringify(item, ctx, onComment, onChompKeep) {
...
return stringifyString({ value: key }, ctx, onComment, onChompKeep)
}
It worked in v1.10 but in v2.1 it returns type error:
Argument of type '{ value: string; }' is not assignable to parameter of type 'Scalar<unknown>'.
Type '{ value: string; }' is missing the following properties from type 'Scalar<unknown>': toJSON, clone, [NODE_TYPE]
To Reproduce
Create custom tag with
stringify(item, ctx, onComment, onChompKeep) {
return stringifyString({ value: 'test' }, ctx, onComment, onChompKeep)
}
Expected behaviour
No error.
Versions:
- Environment: Node: 19.1.0
yaml
: yaml: 2.1.3