NodeBuilder.addNode( node as Node ) as This NodeBuilder object
Add a node to the node tree the builder is building.
Parameters | |
---|---|
node | The node to add. |
const builder = new NodeBuilder(); builder.addNode( { lat: 12.2, long: -122.45, handle: '@johnqpublic', text: 'Here is my first tweet!' } ); builder.toNode(); // Returns a JSON object node equivalent to the following: // // { "lat":12.2, // "long":-122.45, // "handle":"@johnqpublic", // "text":"Here is my first tweet!" // }