From f35fa0999f8aecc7655797971fc9e773b35fb80f Mon Sep 17 00:00:00 2001 From: amddg44 Date: Tue, 10 Dec 2024 12:47:13 +0100 Subject: [PATCH] Updates due to moving to Core --- Core/AutofillInterfaceEmailTruncator.swift | 4 ++-- Core/PasswordHider.swift | 10 +++++++--- 2 files changed, 9 insertions(+), 5 deletions(-) diff --git a/Core/AutofillInterfaceEmailTruncator.swift b/Core/AutofillInterfaceEmailTruncator.swift index 2eb28faa1b..41fb28342c 100644 --- a/Core/AutofillInterfaceEmailTruncator.swift +++ b/Core/AutofillInterfaceEmailTruncator.swift @@ -19,8 +19,8 @@ import Foundation -struct AutofillInterfaceEmailTruncator { - static func truncateEmail(_ email: String, maxLength: Int) -> String { +public struct AutofillInterfaceEmailTruncator { + public static func truncateEmail(_ email: String, maxLength: Int) -> String { let emailComponents = email.components(separatedBy: "@") if emailComponents.count > 1 && email.count > maxLength { let ellipsis = "..." diff --git a/Core/PasswordHider.swift b/Core/PasswordHider.swift index 1849248f24..ffe3a70929 100644 --- a/Core/PasswordHider.swift +++ b/Core/PasswordHider.swift @@ -19,11 +19,15 @@ import Foundation -struct PasswordHider { - let password: String - var hiddenPassword: String { +public struct PasswordHider { + public let password: String + public var hiddenPassword: String { let maximumPasswordDisplayCount = 22 let passwordCount = password.count > maximumPasswordDisplayCount ? maximumPasswordDisplayCount : password.count return String(repeating: "•", count: passwordCount) } + + public init(password: String) { + self.password = password + } }