Skip to main content

JsonObject Class

Arbitrary JSON object as a TreeNode.

This API is provided as an alpha preview and may change without notice.

For more information about our API support guarantees, see here.

Signature

/** @sealed */
class JsonObject extends _APIExtractorWorkaroundObjectBase

Extends: _APIExtractorWorkaroundObjectBase

Remarks

API of the tree node is more aligned with an es6 map than a JS object using its properties like a map.

Example

// Due to TypeScript restrictions on recursive types, the constructor and be somewhat limiting.
const fromArray = new JsonAsTreeObject([["a", 0]]);
// Using `importConcise` can work better for JSON data:
const imported = TreeAlpha.importConcise(JsonAsTree.Object, { a: 0 });
// Node API is like a Map:
const value = imported.get("a");