1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 10:15:55 +03:00

Arrays of CustomJSONConvertible elements have a JSON property.

This commit is contained in:
Rob Rix 2015-10-28 17:51:27 -04:00
parent 6688f223fe
commit ef7ce734d7

View File

@ -191,6 +191,12 @@ extension Int: CustomJSONConvertible {
}
}
extension Array where Element: CustomJSONConvertible {
public var JSON: Doubt.JSON {
return .Array(map(Doubt.JSON.init))
}
}
/// A type which can be converted to and from JSON.
public protocol JSONConvertible: CustomJSONConvertible {