Skip to content

Instantly share code, notes, and snippets.

@bricker
Created April 5, 2021 06:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bricker/709a0f2613d87d3f67e5618873811f47 to your computer and use it in GitHub Desktop.
Save bricker/709a0f2613d87d3f67e5618873811f47 to your computer and use it in GitHub Desktop.
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