mirror of
https://github.com/metabolist/metatext
synced 2024-12-20 14:32:48 +01:00
18 lines
387 B
Swift
18 lines
387 B
Swift
// Copyright © 2020 Metabolist. All rights reserved.
|
|
|
|
import Foundation
|
|
import Mastodon
|
|
|
|
struct HTTPStubs {
|
|
static func stub(
|
|
request: URLRequest,
|
|
target: HTTPTarget? = nil,
|
|
userInfo: [String: Any] = [:]) -> HTTPStub? {
|
|
guard let url = request.url else {
|
|
return nil
|
|
}
|
|
|
|
return (target as? Stubbing)?.stub(url: url)
|
|
}
|
|
}
|