isJsonSafe static method

bool isJsonSafe(
  1. Object? value
)

Returns true if value is JSON-safe.

Implementation

static bool isJsonSafe(Object? value) {
  try {
    validate(value);
    return true;
  } on FormatException {
    return false;
  }
}