Skip to content

Commit 3f74958

Browse files
authored
Merge pull request #1 from brianmichel/brian/remove-corefoundation-for-portability
Remove CoreFoundation Imports
2 parents 1fa21cd + bdd2ad9 commit 3f74958

File tree

3 files changed

+4
-8
lines changed

3 files changed

+4
-8
lines changed

Sources/JSONSafeEncoder/JSONError.swift

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,6 @@ Copyright (c) 2023 Twilio Inc.
1919

2020

2121
import Foundation
22-
import CoreFoundation
2322

2423
enum JSONError: Swift.Error, Equatable {
2524
case cannotConvertInputDataToUTF8

Sources/JSONSafeEncoder/JSONSafeEncoder.swift

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Copyright (c) 2023 Twilio Inc.
1818
---------------------------------------------------------------------------------------------**/
1919

2020
import Foundation
21-
import CoreFoundation
2221

2322
/// A marker protocol used to determine whether a value is a `String`-keyed `Dictionary`
2423
/// containing `Encodable` values (in which case it should be exempt from key conversion strategies).
@@ -102,16 +101,16 @@ open class JSONSafeEncoder {
102101
public enum NonConformingFloatEncodingStrategy {
103102
/// Throw upon encountering non-conforming values. This is the default strategy.
104103
case `throw`
105-
104+
106105
/// Set the value to null, like Javascript does.
107106
case `null`
108-
107+
109108
/// Set the value to zero, the safest option for Swift decoding.
110109
case zero
111110

112111
/// Encode the values using the given representation strings.
113112
case convertToString(positiveInfinity: String, negativeInfinity: String, nan: String)
114-
113+
115114
/// Default strings, similar to Python
116115
static var convertToStringDefaults = NonConformingFloatEncodingStrategy.convertToString(
117116
positiveInfinity: "Infinity",

Sources/JSONSafeEncoder/JSONValue.swift

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,6 @@ Copyright (c) 2023 Twilio Inc.
1818
---------------------------------------------------------------------------------------------**/
1919

2020
import Foundation
21-
import CoreFoundation
2221

2322
internal enum JSONValue: Equatable {
2423
case string(String)
@@ -39,7 +38,7 @@ extension JSONValue {
3938
return true
4039
}
4140
}
42-
41+
4342
var isContainer: Bool {
4443
switch self {
4544
case .array, .object:
@@ -101,4 +100,3 @@ private extension JSONValue {
101100
}
102101
}
103102
}
104-

0 commit comments

Comments
 (0)