Created
April 5, 2021 06:05
-
-
Save bricker/709a0f2613d87d3f67e5618873811f47 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
extension JSONValue { | |
public var value: JSONPrimitive? { | |
switch self { | |
case .object(let value): return value | |
case .array(let value): return value | |
case .string(let value): return value | |
case .number(let value): return value | |
case .boolean(let value): return value | |
case .null: return nil | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment