Skip to content

Commit 45154f9

Browse files
committed
TopLevelEncoder/Decoder
1 parent a0baaa0 commit 45154f9

File tree

2 files changed

+14
-0
lines changed

2 files changed

+14
-0
lines changed

Sources/KeyValueDecoder.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,13 @@ public final class KeyValueDecoder {
8484
}
8585
}
8686

87+
#if canImport(Combine)
88+
import Combine
89+
extension KeyValueDecoder: TopLevelDecoder {
90+
public typealias Input = Any
91+
}
92+
#endif
93+
8794
extension KeyValueDecoder {
8895

8996
static func makePlistCompatible() -> KeyValueDecoder {

Sources/KeyValueEncoder.swift

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,6 +75,13 @@ public enum NilCodingStrategy: Sendable {
7575
public static var nsNull: NilCodingStrategy { .placeholder(NSNull(), isNull: { $0 is NSNull }) }
7676
}
7777

78+
#if canImport(Combine)
79+
import Combine
80+
extension KeyValueEncoder: TopLevelEncoder {
81+
public typealias Output = Any?
82+
}
83+
#endif
84+
7885
extension KeyValueEncoder {
7986

8087
static func makePlistCompatible() -> KeyValueEncoder {

0 commit comments

Comments
 (0)