mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-09 15:51:05 +00:00
Merge commit 'fa7db608f85bb5c176f9c7daf7517c52a1e94283'
This commit is contained in:
commit
c1dcfbc031
@ -35,7 +35,18 @@ public indirect enum JSON: PostboxCoding, Equatable {
|
||||
}
|
||||
}
|
||||
self = .dictionary(values)
|
||||
} else if let value = object as? String {
|
||||
} else if let array = object as? [Any] {
|
||||
var values: [JSON] = []
|
||||
for value in array {
|
||||
if let v = JSON(value) {
|
||||
values.append(v)
|
||||
} else {
|
||||
return nil
|
||||
}
|
||||
}
|
||||
self = .array(values)
|
||||
}
|
||||
else if let value = object as? String {
|
||||
self = .string(value)
|
||||
} else if let value = object as? Int {
|
||||
self = .number(Double(value))
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user