Showing 1 of 1 files from the diff.

@@ -22,7 +22,7 @@
Loading
22 22
23 23
  /// Constructs a [JsonString] if [source] is a valid JSON.
24 24
  ///
25 -
  /// If not, it returns [null].
25 +
  /// If not, it returns `null`.
26 26
  ///
27 27
  /// If the optional [enableCache] parameter is set to `true`,
28 28
  /// a cache of the decoded value is provided.
@@ -49,7 +49,7 @@
Loading
49 49
  /// Constructs a [JsonString] converting [value] into a valid JSON
50 50
  /// primitive value.
51 51
  ///
52 -
  /// [T] must be a primitive type (int, double, bool or String).
52 +
  /// [T] must be a primitive type (int, double, bool, String or Null).
53 53
  static JsonString encodePrimitiveValue<T>(T value) {
54 54
    assert(value != null);
55 55
    return wrapJsonUtilOperation(() {
@@ -60,7 +60,7 @@
Loading
60 60
61 61
  /// Constructs a [JsonString] converting [list] into a valid JSON List.
62 62
  ///
63 -
  /// [T] must be a primitive type (int, double, bool or String).
63 +
  /// [T] must be a primitive type (int, double, bool, String or Null).
64 64
  static JsonString encodePrimitiveList<T>(List<T> list) {
65 65
    assert(list != null);
66 66
    return wrapJsonUtilOperation(() {
@@ -188,16 +188,12 @@
Loading
188 188
  static JsonString _constructJsonString(String source, bool enableCache) {
189 189
    final decodedSource = DecodedValue.from(source);
190 190
    final cachedValue = enableCache ? decodedSource : null;
191 -
    return JsonString._(_encode(decodedSource.value), cachedValue);
192 -
  }
193 -
194 -
  static String _encode(Object value, {Function(Object) encoder}) {
195 -
    return convertEncode(value, toEncodable: encoder);
191 +
    return JsonString._(convertEncode(decodedSource.value), cachedValue);
196 192
  }
197 193
198 194
  static String _encodeSafely(Object value, {Function(Object) encoder}) {
199 195
    try {
200 -
      return _encode(value, encoder: encoder);
196 +
      return convertEncode(value, toEncodable: encoder);
201 197
    } catch (e) {
202 198
      throw JsonEncodingError(e);
203 199
    }
Files Coverage
lib/src 100.00%
Project Totals (3 files) 100.00%
Untitled

No yaml found.

Create your codecov.yml to customize your Codecov experience

Sunburst
The inner-most circle is the entire project, moving away from the center are folders then, finally, a single file. The size and color of each slice is representing the number of statements and the coverage, respectively.
Icicle
The top section represents the entire project. Proceeding with folders and finally individual files. The size and color of each slice is representing the number of statements and the coverage, respectively.
Grid
Each block represents a single file in the project. The size and color of each block is represented by the number of statements and the coverage, respectively.
Loading