Interface: ToJsonOptions
json.ToJsonOptions
Options for the toJson function
Table of contents
Properties
Properties
ignoreValues
• Optional
ignoreValues: boolean
Whether to ignore values on the root node
Turning this option on deviates from the JiK standard by ignoring all values on the root node. This makes it possible to encode parameterized nodes as JiK.
For example, every book
node in the following document is a JiK node:
book "The Fellowship of the Ring" {
author "J.R.R. Tolkien"
publicationYear 1954
}
book "Dune" publicationYear=1965 {
author "Frank Herbert"
}
Here's how this could be turned into an map containing all books:
const books = new Map(
document.findNodesByName('book').map(node => [
node.getArgument(0),
toJson(node, {ignoreValues: true}),
]),
)