dataToString static method

String dataToString({
  1. required dynamic data,
  2. required List<HideRegExp> hideRegExps,
  3. bool ignoreError = false,
})

Implementation

static String dataToString({
  required dynamic data,
  required List<HideRegExp> hideRegExps,
  bool ignoreError = false,
}) {
  dynamic result = dataToOrigin(
    data: data,
    hideRegExps: hideRegExps,
    ignoreError: ignoreError,
  );
  if (result is Map || result is List) {
    return json.encode(result);
  } else if (result is String) {
    return result;
  } else {
    return "${result}";
  }
}