File tree 3 files changed +4
-8
lines changed
3 files changed +4
-8
lines changed Original file line number Diff line number Diff line change @@ -19,7 +19,6 @@ Copyright (c) 2023 Twilio Inc.
19
19
20
20
21
21
import Foundation
22
- import CoreFoundation
23
22
24
23
enum JSONError : Swift . Error , Equatable {
25
24
case cannotConvertInputDataToUTF8
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ Copyright (c) 2023 Twilio Inc.
18
18
---------------------------------------------------------------------------------------------**/
19
19
20
20
import Foundation
21
- import CoreFoundation
22
21
23
22
/// A marker protocol used to determine whether a value is a `String`-keyed `Dictionary`
24
23
/// containing `Encodable` values (in which case it should be exempt from key conversion strategies).
@@ -102,16 +101,16 @@ open class JSONSafeEncoder {
102
101
public enum NonConformingFloatEncodingStrategy {
103
102
/// Throw upon encountering non-conforming values. This is the default strategy.
104
103
case `throw`
105
-
104
+
106
105
/// Set the value to null, like Javascript does.
107
106
case `null`
108
-
107
+
109
108
/// Set the value to zero, the safest option for Swift decoding.
110
109
case zero
111
110
112
111
/// Encode the values using the given representation strings.
113
112
case convertToString( positiveInfinity: String , negativeInfinity: String , nan: String )
114
-
113
+
115
114
/// Default strings, similar to Python
116
115
static var convertToStringDefaults = NonConformingFloatEncodingStrategy . convertToString (
117
116
positiveInfinity: " Infinity " ,
Original file line number Diff line number Diff line change @@ -18,7 +18,6 @@ Copyright (c) 2023 Twilio Inc.
18
18
---------------------------------------------------------------------------------------------**/
19
19
20
20
import Foundation
21
- import CoreFoundation
22
21
23
22
internal enum JSONValue : Equatable {
24
23
case string( String )
@@ -39,7 +38,7 @@ extension JSONValue {
39
38
return true
40
39
}
41
40
}
42
-
41
+
43
42
var isContainer : Bool {
44
43
switch self {
45
44
case . array, . object:
@@ -101,4 +100,3 @@ private extension JSONValue {
101
100
}
102
101
}
103
102
}
104
-
You can’t perform that action at this time.
0 commit comments