mirror of
https://github.com/oxen-io/session-ios.git
synced 2023-12-13 21:30:14 +01:00
14 lines
531 B
Swift
14 lines
531 B
Swift
|
|
||
|
internal extension Dictionary {
|
||
|
|
||
|
var prettifiedDescription: String {
|
||
|
return "[ " + map { key, value in
|
||
|
let keyDescription = String(describing: key)
|
||
|
let valueDescription = String(describing: value)
|
||
|
let maxLength = 20
|
||
|
let truncatedValueDescription = valueDescription.count > maxLength ? valueDescription.prefix(maxLength) + "..." : valueDescription
|
||
|
return keyDescription + " : " + truncatedValueDescription
|
||
|
}.joined(separator: ", ") + " ]"
|
||
|
}
|
||
|
}
|