mirror of
https://github.com/kean/Pulse.git
synced 2026-05-30 21:07:33 +00:00
23 lines
605 B
Swift
23 lines
605 B
Swift
// The MIT License (MIT)
|
|
//
|
|
// Copyright (c) 2020-2024 Alexander Grebenyuk (github.com/kean).
|
|
|
|
import Foundation
|
|
import Pulse
|
|
|
|
enum ConsoleViewDelegate {
|
|
static func getTitle(for task: NetworkTaskEntity) -> String? {
|
|
if let taskDescription = task.taskDescription, !taskDescription.isEmpty {
|
|
return taskDescription
|
|
}
|
|
return task.url
|
|
}
|
|
|
|
static func getShortTitle(for task: NetworkTaskEntity) -> String {
|
|
guard let title = getTitle(for: task) else {
|
|
return ""
|
|
}
|
|
return URL(string: title)?.lastPathComponent ?? title
|
|
}
|
|
}
|