@@ -65,7 +65,7 @@ open class JSONEncoder {
65
65
/// The strategy to use for encoding `Data` values.
66
66
public enum DataEncodingStrategy {
67
67
/// Encoded the `Data` as a Base64-encoded string. This is the default strategy.
68
- case base64Encode
68
+ case base64
69
69
70
70
/// Encode the `Data` as a custom value encoded by the given closure.
71
71
///
@@ -88,8 +88,8 @@ open class JSONEncoder {
88
88
/// The strategy to use in encoding dates. Defaults to `.deferredToDate`.
89
89
open var dateEncodingStrategy : DateEncodingStrategy = . deferredToDate
90
90
91
- /// The strategy to use in encoding binary data. Defaults to `.base64Encode `.
92
- open var dataEncodingStrategy : DataEncodingStrategy = . base64Encode
91
+ /// The strategy to use in encoding binary data. Defaults to `.base64 `.
92
+ open var dataEncodingStrategy : DataEncodingStrategy = . base64
93
93
94
94
/// The strategy to use in encoding non-conforming numbers. Defaults to `.throw`.
95
95
open var nonConformingFloatEncodingStrategy : NonConformingFloatEncodingStrategy = . throw
@@ -672,7 +672,7 @@ extension _JSONEncoder {
672
672
673
673
fileprivate func box( _ data: Data ) throws -> NSObject {
674
674
switch self . options. dataEncodingStrategy {
675
- case . base64Encode :
675
+ case . base64 :
676
676
return NSString ( string: data. base64EncodedString ( ) )
677
677
678
678
case . custom( let closure) :
@@ -827,7 +827,7 @@ open class JSONDecoder {
827
827
/// The strategy to use for decoding `Data` values.
828
828
public enum DataDecodingStrategy {
829
829
/// Decode the `Data` from a Base64-encoded string. This is the default strategy.
830
- case base64Decode
830
+ case base64
831
831
832
832
/// Decode the `Data` as a custom value decoded by the given closure.
833
833
case custom( ( _ decoder: Decoder ) throws -> Data )
@@ -845,8 +845,8 @@ open class JSONDecoder {
845
845
/// The strategy to use in decoding dates. Defaults to `.deferredToDate`.
846
846
open var dateDecodingStrategy : DateDecodingStrategy = . deferredToDate
847
847
848
- /// The strategy to use in decoding binary data. Defaults to `.base64Decode `.
849
- open var dataDecodingStrategy : DataDecodingStrategy = . base64Decode
848
+ /// The strategy to use in decoding binary data. Defaults to `.base64 `.
849
+ open var dataDecodingStrategy : DataDecodingStrategy = . base64
850
850
851
851
/// The strategy to use in decoding non-conforming numbers. Defaults to `.throw`.
852
852
open var nonConformingFloatDecodingStrategy : NonConformingFloatDecodingStrategy = . throw
@@ -2042,7 +2042,7 @@ extension _JSONDecoder {
2042
2042
guard !( value is NSNull ) else { return nil }
2043
2043
2044
2044
switch self . options. dataDecodingStrategy {
2045
- case . base64Decode :
2045
+ case . base64 :
2046
2046
guard let string = value as? String else {
2047
2047
throw DecodingError . _typeMismatch ( at: self . codingPath, expectation: type, reality: value)
2048
2048
}
0 commit comments