toNode method

  1. @override
IPLDNode toNode()
override

Encode this selector as an IPLDNode using the official compact DAG-CBOR/DAG-JSON selector schema.

Implementation

@override
IPLDNode toNode() {
  final body = <String, IPLDNode>{};
  if (condition != null) {
    body['&'] = condition!.toNode();
  }
  if (next != null) {
    body['>'] = next!.toNode();
  }
  return _singleKeyMap('&', _mapNode(body));
}