This repository was archived by the owner on Jul 30, 2024. It is now read-only.
File tree Expand file tree Collapse 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 Expand file tree Collapse file tree 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 {
1212 myURL.search = " abc=xyz"
1313 assert(myURL.href === " https://example.org/abc?abc=xyz" )
1414 }
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+ }
1523 }
1624}
Original file line number Diff line number Diff line change @@ -5,17 +5,12 @@ import scala.scalajs.js
55import scala .scalajs .js .annotation .JSImport
66import scala .scalajs .js .|
77
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- */
148@ js.native
159@ 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 ()
1914
2015 /**
2116 * 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