Skip to content

Commit 05f6318

Browse files
committed
Update .swiftformat
1 parent 2d275c0 commit 05f6318

File tree

2 files changed

+8
-4
lines changed

2 files changed

+8
-4
lines changed

.swiftformat

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
--disable \
2+
hoistAwait, \
3+
hoistTry
4+
15
--funcattributes prev-line
26
--minversion 0.47.2
37
--maxwidth 96

Sources/JSON/JSON.swift

+4-4
Original file line numberDiff line numberDiff line change
@@ -203,7 +203,7 @@ extension JSON: Equatable {
203203
}
204204
}
205205

206-
public extension Optional where Wrapped == JSON {
206+
public extension JSON? {
207207
subscript(key: String) -> JSON? {
208208
get {
209209
guard case let .dictionary(dict) = self else { return nil }
@@ -347,13 +347,13 @@ public extension Optional where Wrapped == JSON {
347347
}
348348
}
349349

350-
extension Array where Element == Any? {
350+
extension [Any?] {
351351
var json: JSON {
352352
.array(compactMap(\.json))
353353
}
354354
}
355355

356-
public extension Dictionary where Key == String, Value == Any? {
356+
public extension [String: Any?] {
357357
var json: JSON {
358358
var dictionary = [String: JSON]()
359359
for (key, value) in self {
@@ -364,7 +364,7 @@ public extension Dictionary where Key == String, Value == Any? {
364364
}
365365
}
366366

367-
private extension Optional where Wrapped == Any {
367+
private extension Any? {
368368
var json: JSON? {
369369
guard case let .some(element) = self else { return .null }
370370

0 commit comments

Comments
 (0)