AsdfNode.removed

Returns the subset of the object-tree which is not represented in node. If a leaf is represented but has a different value then it will be included in the return value. Returned value has ASDF format and its leaves are set to null.

struct AsdfNode
pure
removed

Examples

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

Meta