11// deno-lint-ignore-file no-unused-vars
22class URL {
3- // TODO: Need to return a URL object.
4- constructor ( url : string , base ?: string ) {
5- // @ts -ignore - this is a hack to make the URL object work
6- this . url = url ;
7- // @ts -ignore - this is a hack to make the Base URL object work
8- this . base = base ;
9- // @ts -ignore - this is a hack to make the URL object work
10- this . serialized = base
11- ? internal_url_parse ( url , base )
12- : internal_url_parse_no_base ( url ) ;
13- }
3+ // TODO: Need to return a URL object.
4+ constructor ( url : string , base ?: string ) {
5+ // @ts -ignore - this is a hack to make the URL object work
6+ this . url = url ;
7+ // @ts -ignore - this is a hack to make the Base URL object work
8+ this . base = base ;
9+ // @ts -ignore - this is a hack to make the URL object work
10+ this . serialized = base
11+ ? internal_url_parse ( url , base )
12+ : internal_url_parse_no_base ( url ) ;
13+ }
1414
15- toString ( ) {
16- // @ts -ignore - this is a hack to make the URL object work
17- return this . serialized ;
18- }
15+ toString ( ) {
16+ // @ts -ignore - this is a hack to make the URL object work
17+ return this . serialized ;
18+ }
1919
20- static parse ( url : string , base ?: string ) {
21- return new this ( url , base )
22- }
23- }
20+ static parse ( url : string , base ?: string ) {
21+ return new this ( url , base ) ;
22+ }
23+ }
0 commit comments