This repository was archived by the owner on Jul 30, 2024. It is now read-only.
File tree 2 files changed +12
-9
lines changed
nodejs-v10/src/test/scala/io/scalajs/nodejs/url
nodejs-v14/src/main/scala/io/scalajs/nodejs/url 2 files changed +12
-9
lines changed Original file line number Diff line number Diff line change @@ -12,5 +12,13 @@ class URLTest extends AnyFunSpec {
12
12
myURL.search = " abc=xyz"
13
13
assert(myURL.href === " https://example.org/abc?abc=xyz" )
14
14
}
15
+
16
+ it(" should support base URL string" ) {
17
+ val url1 = new URL (" /abc?123" , " https://example.org" )
18
+ assert(url1.href === " https://example.org/abc?123" )
19
+
20
+ val url2 = new URL (" /abc?123" , new URL (" https://example.org" ))
21
+ assert(url2.href === " https://example.org/abc?123" )
22
+ }
15
23
}
16
24
}
Original file line number Diff line number Diff line change @@ -5,17 +5,12 @@ import scala.scalajs.js
5
5
import scala .scalajs .js .annotation .JSImport
6
6
import scala .scalajs .js .|
7
7
8
- /**
9
- * This module has utilities for URL resolution and parsing. Call require('url') to use it.
10
- * @param input The input URL to parse
11
- * @param base The base URL to resolve against if the input is not absolute.
12
- * @see https://nodejs.org/api/url.html
13
- */
14
8
@ js.native
15
9
@ JSImport (" url" , " URL" )
16
- class URL (input : String , base : String ) extends js.Object {
17
- def this (input : String , base : URL ) = this (input, " " )
18
- def this (input : String ) = this (input, " " )
10
+ class URL protected () extends js.Object {
11
+ def this (input : String , base : String ) = this ()
12
+ def this (input : String , base : URL ) = this ()
13
+ def this (input : String ) = this ()
19
14
20
15
/**
21
16
* The auth property is the username and password portion of the URL, also referred to as "userinfo".
You can’t perform that action at this time.
0 commit comments