fix(code_push_protocol): remove unnecessary artifact size transformer
This commit is contained in:
-5
@@ -42,13 +42,8 @@ class CreatePatchArtifactResponse {
|
||||
final String hash;
|
||||
|
||||
/// The size of the artifact in bytes.
|
||||
@JsonKey(fromJson: _parseStringToInt, toJson: _parseIntToString)
|
||||
final int size;
|
||||
|
||||
/// The upload URL for the artifact.
|
||||
final String uploadUrl;
|
||||
|
||||
static int _parseStringToInt(dynamic value) => int.parse(value as String);
|
||||
|
||||
static String _parseIntToString(dynamic value) => value.toString();
|
||||
}
|
||||
|
||||
+2
-3
@@ -20,8 +20,7 @@ CreatePatchArtifactResponse _$CreatePatchArtifactResponseFromJson(
|
||||
arch: $checkedConvert('arch', (v) => v as String),
|
||||
platform: $checkedConvert('platform', (v) => v as String),
|
||||
hash: $checkedConvert('hash', (v) => v as String),
|
||||
size: $checkedConvert(
|
||||
'size', (v) => CreatePatchArtifactResponse._parseStringToInt(v)),
|
||||
size: $checkedConvert('size', (v) => v as int),
|
||||
uploadUrl: $checkedConvert('upload_url', (v) => v as String),
|
||||
);
|
||||
return val;
|
||||
@@ -37,6 +36,6 @@ Map<String, dynamic> _$CreatePatchArtifactResponseToJson(
|
||||
'arch': instance.arch,
|
||||
'platform': instance.platform,
|
||||
'hash': instance.hash,
|
||||
'size': CreatePatchArtifactResponse._parseIntToString(instance.size),
|
||||
'size': instance.size,
|
||||
'upload_url': instance.uploadUrl,
|
||||
};
|
||||
|
||||
-5
@@ -42,13 +42,8 @@ class CreateReleaseArtifactResponse {
|
||||
final String hash;
|
||||
|
||||
/// The size of the artifact in bytes.
|
||||
@JsonKey(fromJson: _parseStringToInt, toJson: _parseIntToString)
|
||||
final int size;
|
||||
|
||||
/// The upload URL for the artifact.
|
||||
final String uploadUrl;
|
||||
|
||||
static int _parseStringToInt(dynamic value) => int.parse(value as String);
|
||||
|
||||
static String _parseIntToString(dynamic value) => value.toString();
|
||||
}
|
||||
|
||||
+2
-3
@@ -20,8 +20,7 @@ CreateReleaseArtifactResponse _$CreateReleaseArtifactResponseFromJson(
|
||||
arch: $checkedConvert('arch', (v) => v as String),
|
||||
platform: $checkedConvert('platform', (v) => v as String),
|
||||
hash: $checkedConvert('hash', (v) => v as String),
|
||||
size: $checkedConvert('size',
|
||||
(v) => CreateReleaseArtifactResponse._parseStringToInt(v)),
|
||||
size: $checkedConvert('size', (v) => v as int),
|
||||
uploadUrl: $checkedConvert('upload_url', (v) => v as String),
|
||||
);
|
||||
return val;
|
||||
@@ -37,6 +36,6 @@ Map<String, dynamic> _$CreateReleaseArtifactResponseToJson(
|
||||
'arch': instance.arch,
|
||||
'platform': instance.platform,
|
||||
'hash': instance.hash,
|
||||
'size': CreateReleaseArtifactResponse._parseIntToString(instance.size),
|
||||
'size': instance.size,
|
||||
'upload_url': instance.uploadUrl,
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user