minify<K> function

Map<K, dynamic>? minify<K>(
  1. Map<K, dynamic>? json
)

Minimizes the JSON map to be stored into DB or sent over internet by removing the entries whose value is null.

It can be useful when implementing a plugin, since you don't have to store the null values (in a key-value-type database).

It is also useful if an entity contains a PODO object whose toJson() returns a map with several null values, such as

class Inner {
  String some;
  String another;
  toJson() => minify({"some": some, "another": another})
}

Implementation

Map<K, dynamic>? minify<K>(Map<K, dynamic>? json)
=> json == null ? null: minifyNS(json);