Returns true if value is a JSON primitive (String, bool, num, int, double, or null).
true
value
bool isJSONPrimitive(Object? value) { return value == null || value is String || value is num || value is bool; }