Skip to content

Commit

Permalink
#20 add default values to kodabletransformer init
Browse files Browse the repository at this point in the history
  • Loading branch information
JARMourato committed Nov 25, 2022
2 parents cc8e767 + 360c226 commit a063951
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions Sources/Kodable/KodableTransformable.swift
Original file line number Diff line number Diff line change
Expand Up @@ -48,18 +48,18 @@ public protocol KodableTransform {
set { try? setValue(newValue) }
}

public init(key: String? = nil, options: [KodableOption<TargetType>], defaultValue: TargetType?) {
self.key = key
self.options = options
_value = defaultValue
}

// MARK: Public Initializers

public init() {
options = []
}

public init(key: String? = nil, options: [KodableOption<TargetType>] = [], defaultValue: TargetType? = nil) {
self.key = key
self.options = options
_value = defaultValue
}

// MARK: Codable Conformance

/// All custom behavior is lost when the `Decodable` initializer is used
Expand Down

0 comments on commit a063951

Please sign in to comment.