(resource: FetchResource)
| 230 | } |
| 231 | |
| 232 | function getUrlFromResource(resource: FetchResource): string { |
| 233 | if (typeof resource === 'string') { |
| 234 | return resource; |
| 235 | } |
| 236 | |
| 237 | if (!resource) { |
| 238 | return ''; |
| 239 | } |
| 240 | |
| 241 | if (hasProp(resource, 'url')) { |
| 242 | return resource.url; |
| 243 | } |
| 244 | |
| 245 | if (resource.toString) { |
| 246 | return resource.toString(); |
| 247 | } |
| 248 | |
| 249 | return ''; |
| 250 | } |
| 251 | |
| 252 | /** |
| 253 | * Parses the fetch arguments to find the used Http method and the url of the request. |
no test coverage detected