Skip to content

Commit 2b61d99

Browse files
committed
feat: Make Path Decodable
1 parent 63b0c15 commit 2b61d99

1 file changed

Lines changed: 11 additions & 0 deletions

File tree

Sources/PathKit.swift

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -808,3 +808,14 @@ extension Array {
808808
return self[self.indices.suffix(from: 0)]
809809
}
810810
}
811+
812+
813+
// MARK: Decodable
814+
815+
extension Path: Decodable {
816+
public init(from decoder: Decoder) throws {
817+
let container = try decoder.singleValueContainer()
818+
let decodedString = try container.decode(String.self)
819+
self.init(decodedString)
820+
}
821+
}

0 commit comments

Comments
 (0)