File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -145,6 +145,16 @@ extension Dictionary: JSONEncodable {
145145 }
146146}
147147
148+ extension Dictionary : JSONDecodable {
149+ public init ( jsonValue value: JSONValue ) throws {
150+ guard let dictionary = value as? Dictionary else {
151+ throw JSONDecodingError . couldNotConvert ( value: value, to: Dictionary . self)
152+ }
153+
154+ self = dictionary
155+ }
156+ }
157+
148158extension Array : JSONEncodable {
149159 public var jsonValue : JSONValue {
150160 return map ( ) { element -> ( JSONValue ) in
Original file line number Diff line number Diff line change @@ -74,13 +74,3 @@ class JSONTests: XCTestCase {
7474""" )
7575 }
7676}
77-
78- extension Dictionary : JSONDecodable {
79- public init ( jsonValue value: JSONValue ) throws {
80- guard let dictionary = value as? Dictionary else {
81- throw JSONDecodingError . couldNotConvert ( value: value, to: Dictionary . self)
82- }
83-
84- self = dictionary
85- }
86- }
You can’t perform that action at this time.
0 commit comments