Skip to content

Commit

Permalink
JS yaml: Disable resolveKnownTags for JSON tests
Browse files Browse the repository at this point in the history
  • Loading branch information
eemeli authored and perlpunk committed Jun 10, 2024
1 parent 738e8b7 commit e21316f
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions docker/node/testers/js-yaml-json
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,10 @@ const fs = require('fs')
const YAML = require('yaml')

const src = fs.readFileSync('/dev/stdin').toString()
const docs = YAML.parseAllDocuments(src).map(doc => {
if (doc.errors.length !== 0) throw doc.errors[0]
return JSON.stringify(doc.toJSON(), null, 2) + '\n'
})
const docs = YAML.parseAllDocuments(src, { resolveKnownTags: false }).map(
doc => {
if (doc.errors.length !== 0) throw doc.errors[0]
return JSON.stringify(doc.toJSON(), null, 2) + '\n'
}
)
fs.writeSync(1, docs.join(''))

0 comments on commit e21316f

Please sign in to comment.