Skip to content

Commit 184c688

Browse files
committed
Remove deprecated API in 4.2.0
1 parent b51eb54 commit 184c688

2 files changed

Lines changed: 1 addition & 38 deletions

File tree

Source/SwiftyJSON.swift

Lines changed: 0 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -24,22 +24,6 @@ import Foundation
2424

2525
// MARK: - Error
2626
// swiftlint:disable line_length
27-
/// Error domain
28-
@available(*, deprecated, message: "ErrorDomain is deprecated. Use `SwiftyJSONError.errorDomain` instead.", renamed: "SwiftyJSONError.errorDomain")
29-
public let ErrorDomain: String = "SwiftyJSONErrorDomain"
30-
31-
/// Error code
32-
@available(*, deprecated, message: "ErrorUnsupportedType is deprecated. Use `SwiftyJSONError.unsupportedType` instead.", renamed: "SwiftyJSONError.unsupportedType")
33-
public let ErrorUnsupportedType: Int = 999
34-
@available(*, deprecated, message: "ErrorIndexOutOfBounds is deprecated. Use `SwiftyJSONError.indexOutOfBounds` instead.", renamed: "SwiftyJSONError.indexOutOfBounds")
35-
public let ErrorIndexOutOfBounds: Int = 900
36-
@available(*, deprecated, message: "ErrorWrongType is deprecated. Use `SwiftyJSONError.wrongType` instead.", renamed: "SwiftyJSONError.wrongType")
37-
public let ErrorWrongType: Int = 901
38-
@available(*, deprecated, message: "ErrorNotExist is deprecated. Use `SwiftyJSONError.notExist` instead.", renamed: "SwiftyJSONError.notExist")
39-
public let ErrorNotExist: Int = 500
40-
@available(*, deprecated, message: "ErrorInvalidJSON is deprecated. Use `SwiftyJSONError.invalidJSON` instead.", renamed: "SwiftyJSONError.invalidJSON")
41-
public let ErrorInvalidJSON: Int = 490
42-
4327
public enum SwiftyJSONError: Int, Swift.Error {
4428
case unsupportedType = 999
4529
case indexOutOfBounds = 900
@@ -146,19 +130,6 @@ public struct JSON {
146130
}
147131
}
148132

149-
/**
150-
Creates a JSON from JSON string
151-
152-
- parameter json: Normal json string like '{"a":"b"}'
153-
154-
- returns: The created JSON
155-
*/
156-
@available(*, deprecated, message: "Use instead `init(parseJSON: )`")
157-
public static func parse(_ json: String) -> JSON {
158-
return json.data(using: String.Encoding.utf8)
159-
.flatMap { try? JSON(data: $0) } ?? JSON(NSNull())
160-
}
161-
162133
/**
163134
Creates a JSON using the object.
164135

@@ -592,14 +563,6 @@ extension JSON: Swift.ExpressibleByArrayLiteral {
592563
}
593564
}
594565

595-
extension JSON: Swift.ExpressibleByNilLiteral {
596-
597-
@available(*, deprecated, message: "use JSON.null instead. Will be removed in future versions")
598-
public init(nilLiteral: ()) {
599-
self.init(NSNull() as Any)
600-
}
601-
}
602-
603566
// MARK: - Raw
604567

605568
extension JSON: Swift.RawRepresentable {

Tests/SwiftyJSONTests/PerformanceTests.swift

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -127,7 +127,7 @@ class PerformanceTests: XCTestCase {
127127
self.measure {
128128
autoreleasepool {
129129
if let dictionary = json.dictionary {
130-
XCTAssertTrue(dictionary.count > 0)
130+
XCTAssertTrue(dictionary.count == 100001)
131131
} else {
132132
XCTFail("dictionary should not be nil")
133133
}

0 commit comments

Comments
 (0)