blob: 75be8b812e1c6f43c9e8eece6d4c00b19d95a895 [file] [log] [blame]
Adrià Vilanova Martínez9c418ab2024-12-05 15:34:40 +01001export default class FetchInput {
2 constructor(private input: RequestInfo | URL) {}
3
4 /**
5 * Returns the fetch input URL as a string.
6 */
7 getUrl() {
8 if (typeof this.input === 'string') {
9 return this.input;
10 } else if (this.input instanceof URL) {
11 return this.input.toString();
12 } else {
13 return this.input.url;
14 }
15 }
16}