mirror of
https://github.com/github/semantic.git
synced 2024-12-25 07:55:12 +03:00
Restore the static prisms.
This commit is contained in:
parent
0ca911e603
commit
b5efc49129
@ -41,6 +41,12 @@ public enum JSON {
|
||||
}
|
||||
|
||||
public static let JSON: Prism<AnyObject, Doubt.JSON> = Prism(forward: toJSON, backward: toAnyObject)
|
||||
|
||||
public static let number: Prism<Doubt.JSON, Double> = Prism(forward: { $0.number }, backward: { .Number($0) })
|
||||
public static let boolean: Prism<Doubt.JSON, Bool> = Prism(forward: { $0.boolean }, backward: { .Boolean($0) })
|
||||
public static let string: Prism<Doubt.JSON, Swift.String> = Prism(forward: { $0.string }, backward: { .String($0) })
|
||||
public static let array: Prism<Doubt.JSON, ArrayType> = Prism(forward: { $0.array }, backward: { .Array($0) })
|
||||
public static let dictionary: Prism<Doubt.JSON, DictionaryType> = Prism(forward: { $0.dictionary }, backward: { .Dictionary($0) })
|
||||
}
|
||||
|
||||
public protocol JSONConvertible {
|
||||
|
Loading…
Reference in New Issue
Block a user