1
1
mirror of https://github.com/github/semantic.git synced 2024-11-28 01:47:01 +03:00

Ranges have a JSON property.

This commit is contained in:
Rob Rix 2015-10-28 18:11:01 -04:00
parent ae6ecef9c2
commit ba33e1c4a3

View File

@ -197,6 +197,15 @@ extension Array where Element: CustomJSONConvertible {
}
}
extension Range where Element: CustomJSONConvertible, Element.Distance: CustomJSONConvertible {
public var JSON: Doubt.JSON {
return [
startIndex.JSON,
count.JSON,
]
}
}
/// A type which can be converted to and from JSON.
public protocol JSONConvertible: CustomJSONConvertible {