The resource state to encode
Encoding options
Configuration options for encoding operations.
Optional Readonlybase?: IRIBase IRI for IRI internalisation (must be absolute and hierarchical).
Converts absolute IRIs to internal (root-relative) form.
If omitted, IRIs are internalised against app.
Optional Readonlyindent?: boolean | numberIndentation level for pretty-printing encoded output.
true, uses default indentationfalse or a number less than or equal to 0, disables indentationIf omitted, output is not indented.
The JSON string with internalised IRIs
TypeError If base is not a hierarchical IRI
Encodes a resource state as a JSON string.
Serialises a Resource into a JSON string, recursively internalising absolute IRIs against the provided
base.