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
const Yawn = require('yawn-yaml/cjs')
const input = `
a:
- b
c:
d: e
`
const original = new Yawn(input)
const json = original.json
json.a.push('z')
json.c.f = {}
json.c.f.g = 'h'
console.log(JSON.stringify(json, null, 2))
original.json = json
console.log(original.yaml)
Expected:
{
"a": [
"b",
"z"
],
"c": {
"d": "e",
"f": {
"g": "h"
}
}
}
a:
- b
- z
c:
d: e
f:
g: h
Observed:
{
"a": [
"b",
"z"
],
"c": {
"d": "e",
"f": {
"g": "h"
}
}
}
~/node_modules/yaml-js/lib/scanner.js:504
throw new exports.ScannerError(null, null, 'mapping values are not allowed here', this.get_mark());
^
mapping values are not allowed here
on line 8, column 12
at ScannerError.YAMLError [as constructor] (~/node_modules/yaml-js/lib/errors.js:70:46)
at ScannerError.MarkedYAMLError [as constructor] (~/node_modules/yaml-js/lib/errors.js:90:45)
at new ScannerError (~/node_modules/yaml-js/lib/scanner.js:23:49)
at Constructor.__dirname.Scanner.Scanner.fetch_value (~/node_modules/yaml-js/lib/scanner.js:504:19)
at Constructor.__dirname.Scanner.Scanner.fetch_more_tokens (~/node_modules/yaml-js/lib/scanner.js:214:21)
at Constructor.__dirname.Scanner.Scanner.check_token (~/node_modules/yaml-js/lib/scanner.js:115:14)
at Constructor.__dirname.Parser.Parser.parse_block_mapping_key (~/node_modules/yaml-js/lib/parser.js:421:16)
at Constructor.__dirname.Parser.Parser.check_event (~/node_modules/yaml-js/lib/parser.js:61:48)
at Constructor.__dirname.Composer.Composer.compose_mapping_node (~/node_modules/yaml-js/lib/composer.js:248:20)
at Constructor.__dirname.Composer.Composer.compose_node (~/node_modules/yaml-js/lib/composer.js:160:21)
Process finished with exit code 1
The text was updated successfully, but these errors were encountered:
Executed:
Expected:
Observed:
The text was updated successfully, but these errors were encountered: