selectiveDigestJson function

DigestJsonResult selectiveDigestJson(
  1. Map<String, dynamic> data,
  2. String keepPropertiesList
)

Implementation

DigestJsonResult selectiveDigestJson(
  Map<String, dynamic> data,
  String keepPropertiesList,
) {
  final res = DartApi.instance.selectiveDigestJson(
    json.encode(data),
    keepPropertiesList,
  );

  try {
    return DigestJsonResult(
      collapsedJson: DynamicContent.fromJson(json.decode(res)),
    );
  } catch (e) {
    if (e is FormatException) {
      return DigestJsonResult(contentId: ContentId(res));
    }

    rethrow;
  }
}