FghjNode.added

Returns the subset of the node which is not represented in the object-tree. If a leaf is represented but has a different value then it will be included in the return value. Returned value has FGHJ format.

struct FghjNode
pure
added

Examples

import fghj;
auto text1 = `{"foo":"bar","inner":{"a":false,"b":false,"c":"32323","d":null,"e":{}}}`;
auto text2 = `{"inner":{"a":true,"b":false,"d":null}}`;
auto node1 = FghjNode(text1.parseJson);
auto node2 = FghjNode(text2.parseJson);
auto diff = FghjNode(node2.added(node1));
assert(diff == FghjNode(`{"foo":"bar","inner":{"a":false,"c":"32323","e":{}}}`.parseJson));

Meta