mirror of
https://github.com/hyperoslo/Cache.git
synced 2026-04-07 19:17:36 +00:00
22 lines
384 B
Swift
22 lines
384 B
Swift
import Foundation
|
|
|
|
/**
|
|
Helper enum to work with JSON arrays and dictionaries.
|
|
*/
|
|
public enum JSON {
|
|
/// JSON array
|
|
case array([Any])
|
|
/// JSON dictionary
|
|
case dictionary([String : Any])
|
|
|
|
/// Converts value to Any
|
|
public var object: Any {
|
|
switch self {
|
|
case .array(let object):
|
|
return object
|
|
case .dictionary(let object):
|
|
return object
|
|
}
|
|
}
|
|
}
|