File tree Expand file tree Collapse file tree 16 files changed +21
-13
lines changed Expand file tree Collapse file tree 16 files changed +21
-13
lines changed Original file line number Diff line number Diff line change @@ -26,6 +26,7 @@ public struct Coord: Val {
2626 }
2727}
2828
29+ // Coord + Codable
2930extension Coord : Codable {
3031 static let kindValue = " coord "
3132
Original file line number Diff line number Diff line change @@ -61,13 +61,7 @@ public struct Date: Val {
6161 }
6262}
6363
64- /// Singleton Haystack Date formatter
65- var dateFormatter : ISO8601DateFormatter {
66- let formatter = ISO8601DateFormatter ( )
67- formatter. formatOptions = [ . withFullDate, . withColonSeparatorInTime]
68- return formatter
69- }
70-
64+ // Date + Codable
7165extension Date {
7266 static let kindValue = " date "
7367
Original file line number Diff line number Diff line change @@ -193,6 +193,7 @@ public struct DateTime: Val {
193193
194194var calendar = Calendar ( identifier: . gregorian)
195195
196+ // DateTime + Codable
196197extension DateTime {
197198 static let kindValue = " dateTime "
198199
Original file line number Diff line number Diff line change @@ -40,6 +40,7 @@ public struct Dict: Val {
4040 }
4141}
4242
43+ // Dict + Codable
4344extension Dict {
4445 static let kindValue = " dateTime "
4546
@@ -156,8 +157,8 @@ extension Dict {
156157 }
157158}
158159
159- // Dict + ExpressibleByDictionaryLiteral
160160extension Dict : ExpressibleByDictionaryLiteral {
161+ /// Creates an instance initialized with the given key-value pairs.
161162 public init ( dictionaryLiteral elementLiterals: ( String , any Val ) ... ) {
162163 var elements = [ String : any Val ] ( minimumCapacity: elementLiterals. count)
163164 for (key, value) in elementLiterals {
Original file line number Diff line number Diff line change @@ -51,6 +51,7 @@ public struct Grid: Val {
5151 }
5252}
5353
54+ // Grid + Codable
5455extension Grid {
5556 static let kindValue = " grid "
5657
@@ -100,7 +101,7 @@ extension Grid {
100101 }
101102}
102103
103- // Dict + Equatable
104+ // Grid + Equatable
104105extension Grid {
105106 public static func == ( lhs: Grid , rhs: Grid ) -> Bool {
106107 guard lhs. meta == rhs. meta else {
@@ -132,7 +133,7 @@ extension Grid {
132133 }
133134}
134135
135- // Dict + Hashable
136+ // Grid + Hashable
136137extension Grid {
137138 public func hash( into hasher: inout Hasher ) {
138139 hasher. combine ( meta)
Original file line number Diff line number Diff line change @@ -21,6 +21,7 @@ public struct List: Val {
2121 }
2222}
2323
24+ // List + Codable
2425extension List {
2526
2627 /// Read from decodable data
@@ -84,8 +85,8 @@ extension List {
8485 }
8586}
8687
87- // List + ExpressibleByDictionaryLiteral
8888extension List : ExpressibleByArrayLiteral {
89+ /// Creates an instance initialized with the given elements.
8990 public init ( arrayLiteral: any Val ... ) {
9091 self . elements = arrayLiteral
9192 }
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ public struct Marker: Val {
2222 }
2323}
2424
25+ // Marker + Codable
2526extension Marker {
2627 static let kindValue = " marker "
2728
Original file line number Diff line number Diff line change @@ -22,6 +22,7 @@ public struct NA: Val {
2222 }
2323}
2424
25+ // NA + Codable
2526extension NA {
2627 static let kindValue = " na "
2728
Original file line number Diff line number Diff line change @@ -20,6 +20,7 @@ public struct Null: Val {
2020 }
2121}
2222
23+ // Null + Codable
2324extension Null {
2425
2526 /// Read from decodable data
Original file line number Diff line number Diff line change @@ -53,6 +53,7 @@ public struct Number: Val {
5353 }
5454}
5555
56+ // Number + Codable
5657extension Number {
5758 static let kindValue = " number "
5859
@@ -146,7 +147,7 @@ extension Number {
146147 }
147148}
148149
149- // List + Equatable
150+ // Number + Equatable
150151extension Number {
151152 public static func == ( lhs: Number , rhs: Number ) -> Bool {
152153 guard lhs. unit == rhs. unit else {
You can’t perform that action at this time.
0 commit comments