mirror of
https://github.com/lil-org/tokenary.git
synced 2024-12-12 12:33:42 +03:00
25 lines
486 B
Swift
25 lines
486 B
Swift
// Copyright © 2021 Tokenary. All rights reserved.
|
|
|
|
import Foundation
|
|
|
|
extension String {
|
|
|
|
var maybeJSON: Bool {
|
|
return hasPrefix("{") && hasSuffix("}") && count > 3
|
|
}
|
|
|
|
var isOkAsPassword: Bool {
|
|
return count >= 4
|
|
}
|
|
|
|
var withFirstLetterCapitalized: String {
|
|
guard !isEmpty else { return self }
|
|
return prefix(1).uppercased() + dropFirst()
|
|
}
|
|
|
|
var withEllipsis: String {
|
|
return self + "…"
|
|
}
|
|
|
|
}
|