Skip to content

Commit

Permalink
chore(core): JsonList/Map should implement raw type
Browse files Browse the repository at this point in the history
  • Loading branch information
dnys1 committed Feb 19, 2024
1 parent 3222b85 commit 6ec8277
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions packages/celest_core/lib/src/serialization/json_value.dart
Original file line number Diff line number Diff line change
Expand Up @@ -87,17 +87,12 @@ extension type const JsonDouble(double value) implements JsonNum, double {
extension type const JsonBool(bool value) implements JsonValue, bool {}

/// A [JsonValue] which represents a [List].
extension type const JsonList._(List<JsonValue?> value)
implements JsonValue, List<JsonValue?> {
const JsonList(List<Object?> value) : this._(value as List<JsonValue?>);
}
extension type const JsonList(List<Object?> value)
implements JsonValue, List<Object?> {}

/// A [JsonValue] which represents a [Map].
extension type const JsonMap._(Map<String, JsonValue?> value)
implements JsonValue, Map<String, JsonValue?> {
const JsonMap(Map<String, Object?> value)
: this._(value as Map<String, JsonValue?>);

extension type const JsonMap(Map<String, Object?> value)
implements JsonValue, Map<String, Object?> {
/// Returns the string associated with [key] or `null` if [key] is not in the
/// map.
JsonString? optionalString(String key) {
Expand Down

0 comments on commit 6ec8277

Please sign in to comment.