Skip to content

Commit

Permalink
Add properyWrapper compliant initializers
Browse files Browse the repository at this point in the history
feature/initial-release
  • Loading branch information
roanutil committed Feb 13, 2024
1 parent b548933 commit 7f6862a
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions Sources/Secret/Hashed.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ public struct Hashed<T>: Hashable where T: Hashable {
/// Enabled by default, when encoding, replace the ``wrappedValue`` with its hash.
public let obscureEncoding: Bool

public init(wrappedValue: T, obscureEncoding: Bool = true) {
self.wrappedValue = wrappedValue
self.obscureEncoding = obscureEncoding
}

public init(_ wrappedValue: T, obscureEncoding: Bool = true) {
self.wrappedValue = wrappedValue
self.obscureEncoding = obscureEncoding
Expand Down
5 changes: 5 additions & 0 deletions Sources/Secret/Redacted.swift
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,11 @@ public struct Redacted<T> {
/// Enabled by default, when encoding, replace the ``wrappedValue`` with "REDACTED".
public let obscureEncoding: Bool

public init(wrappedValue: T, obscureEncoding: Bool = true) {
self.wrappedValue = wrappedValue
self.obscureEncoding = obscureEncoding
}

public init(_ wrappedValue: T, obscureEncoding: Bool = true) {
self.wrappedValue = wrappedValue
self.obscureEncoding = obscureEncoding
Expand Down

0 comments on commit 7f6862a

Please sign in to comment.