Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions types/node/test/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,37 @@ import * as url from "node:url";
myURL = new url.URL("/foo", "https://example.org/");
assert.equal(myURL.href, "https://example.org/foo");
assert.equal(myURL.toJSON(), myURL.href);

myURL = new url.URL("https://example.org");
myURL = new url.URL(myURL);
assert.equal(myURL.hash, "");
assert.equal(myURL.host, "example.org");
assert.equal(myURL.hostname, "example.org");
assert.equal(myURL.href, "https://example.org/");
assert.equal(myURL.origin, "https://example.org");
assert.equal(myURL.password, "");
assert.equal(myURL.username, "");
assert.equal(myURL.pathname, "/");
assert.equal(myURL.port, "");
assert.equal(myURL.protocol, "https:");
assert.equal(myURL.search, "");
assert.equal(myURL.toJSON(), myURL.href);
assert(myURL.searchParams instanceof url.URLSearchParams);

myURL = new url.URL({ toString: () => "https://example.org" });
assert.equal(myURL.hash, "");
assert.equal(myURL.host, "example.org");
assert.equal(myURL.hostname, "example.org");
assert.equal(myURL.href, "https://example.org/");
assert.equal(myURL.origin, "https://example.org");
assert.equal(myURL.password, "");
assert.equal(myURL.username, "");
assert.equal(myURL.pathname, "/");
assert.equal(myURL.port, "");
assert.equal(myURL.protocol, "https:");
assert.equal(myURL.search, "");
assert.equal(myURL.toJSON(), myURL.href);
assert(myURL.searchParams instanceof url.URLSearchParams);
}

{
Expand Down
31 changes: 31 additions & 0 deletions types/node/ts4.8/test/url.ts
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,37 @@ import * as url from "node:url";
myURL = new url.URL("/foo", "https://example.org/");
assert.equal(myURL.href, "https://example.org/foo");
assert.equal(myURL.toJSON(), myURL.href);

myURL = new url.URL("https://example.org");
myURL = new url.URL(myURL);
assert.equal(myURL.hash, "");
assert.equal(myURL.host, "example.org");
assert.equal(myURL.hostname, "example.org");
assert.equal(myURL.href, "https://example.org/");
assert.equal(myURL.origin, "https://example.org");
assert.equal(myURL.password, "");
assert.equal(myURL.username, "");
assert.equal(myURL.pathname, "/");
assert.equal(myURL.port, "");
assert.equal(myURL.protocol, "https:");
assert.equal(myURL.search, "");
assert.equal(myURL.toJSON(), myURL.href);
assert(myURL.searchParams instanceof url.URLSearchParams);

myURL = new url.URL({ toString: () => "https://example.org" });
assert.equal(myURL.hash, "");
assert.equal(myURL.host, "example.org");
assert.equal(myURL.hostname, "example.org");
assert.equal(myURL.href, "https://example.org/");
assert.equal(myURL.origin, "https://example.org");
assert.equal(myURL.password, "");
assert.equal(myURL.username, "");
assert.equal(myURL.pathname, "/");
assert.equal(myURL.port, "");
assert.equal(myURL.protocol, "https:");
assert.equal(myURL.search, "");
assert.equal(myURL.toJSON(), myURL.href);
assert(myURL.searchParams instanceof url.URLSearchParams);
}

{
Expand Down
101 changes: 59 additions & 42 deletions types/node/ts4.8/url.d.ts

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion types/node/ts4.8/wasi.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ declare module "wasi" {
* Return an import object that can be passed to `WebAssembly.instantiate()` if no other WASM imports are needed beyond those provided by WASI.
*
* If version `unstable` was passed into the constructor it will return:
*
*
* ```js
* { wasi_unstable: wasi.wasiImport }
* ```
Expand Down
101 changes: 59 additions & 42 deletions types/node/url.d.ts

Large diffs are not rendered by default.

35 changes: 33 additions & 2 deletions types/node/v16/test/url.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Blob } from "node:buffer";
import { Blob as NodeBlob } from "node:buffer";
import assert = require("node:assert");
import { RequestOptions } from "node:http";
import * as url from "node:url";
Expand Down Expand Up @@ -82,6 +82,37 @@ import * as url from "node:url";
myURL = new url.URL("/foo", "https://example.org/");
assert.equal(myURL.href, "https://example.org/foo");
assert.equal(myURL.toJSON(), myURL.href);

myURL = new url.URL("https://example.org");
myURL = new url.URL(myURL);
assert.equal(myURL.hash, "");
assert.equal(myURL.host, "example.org");
assert.equal(myURL.hostname, "example.org");
assert.equal(myURL.href, "https://example.org/");
assert.equal(myURL.origin, "https://example.org");
assert.equal(myURL.password, "");
assert.equal(myURL.username, "");
assert.equal(myURL.pathname, "/");
assert.equal(myURL.port, "");
assert.equal(myURL.protocol, "https:");
assert.equal(myURL.search, "");
assert.equal(myURL.toJSON(), myURL.href);
assert(myURL.searchParams instanceof url.URLSearchParams);

myURL = new url.URL({ toString: () => "https://example.org" });
assert.equal(myURL.hash, "");
assert.equal(myURL.host, "example.org");
assert.equal(myURL.hostname, "example.org");
assert.equal(myURL.href, "https://example.org/");
assert.equal(myURL.origin, "https://example.org");
assert.equal(myURL.password, "");
assert.equal(myURL.username, "");
assert.equal(myURL.pathname, "/");
assert.equal(myURL.port, "");
assert.equal(myURL.protocol, "https:");
assert.equal(myURL.search, "");
assert.equal(myURL.toJSON(), myURL.href);
assert(myURL.searchParams instanceof url.URLSearchParams);
}

{
Expand Down Expand Up @@ -167,7 +198,7 @@ import * as url from "node:url";
const opts: RequestOptions = url.urlToHttpOptions(new url.URL("test.com"));
}
{
const dataUrl: string = url.URL.createObjectURL(new Blob([""]));
const dataUrl: string = url.URL.createObjectURL(new NodeBlob([""]));
}
{
const dataUrl1: URL = new url.URL("file://test");
Expand Down
35 changes: 33 additions & 2 deletions types/node/v16/ts4.8/test/url.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Blob } from "node:buffer";
import { Blob as NodeBlob } from "node:buffer";
import assert = require("node:assert");
import { RequestOptions } from "node:http";
import * as url from "node:url";
Expand Down Expand Up @@ -82,6 +82,37 @@ import * as url from "node:url";
myURL = new url.URL("/foo", "https://example.org/");
assert.equal(myURL.href, "https://example.org/foo");
assert.equal(myURL.toJSON(), myURL.href);

myURL = new url.URL("https://example.org");
myURL = new url.URL(myURL);
assert.equal(myURL.hash, "");
assert.equal(myURL.host, "example.org");
assert.equal(myURL.hostname, "example.org");
assert.equal(myURL.href, "https://example.org/");
assert.equal(myURL.origin, "https://example.org");
assert.equal(myURL.password, "");
assert.equal(myURL.username, "");
assert.equal(myURL.pathname, "/");
assert.equal(myURL.port, "");
assert.equal(myURL.protocol, "https:");
assert.equal(myURL.search, "");
assert.equal(myURL.toJSON(), myURL.href);
assert(myURL.searchParams instanceof url.URLSearchParams);

myURL = new url.URL({ toString: () => "https://example.org" });
assert.equal(myURL.hash, "");
assert.equal(myURL.host, "example.org");
assert.equal(myURL.hostname, "example.org");
assert.equal(myURL.href, "https://example.org/");
assert.equal(myURL.origin, "https://example.org");
assert.equal(myURL.password, "");
assert.equal(myURL.username, "");
assert.equal(myURL.pathname, "/");
assert.equal(myURL.port, "");
assert.equal(myURL.protocol, "https:");
assert.equal(myURL.search, "");
assert.equal(myURL.toJSON(), myURL.href);
assert(myURL.searchParams instanceof url.URLSearchParams);
}

{
Expand Down Expand Up @@ -167,7 +198,7 @@ import * as url from "node:url";
const opts: RequestOptions = url.urlToHttpOptions(new url.URL("test.com"));
}
{
const dataUrl: string = url.URL.createObjectURL(new Blob([""]));
const dataUrl: string = url.URL.createObjectURL(new NodeBlob([""]));
}
{
const dataUrl1: URL = new url.URL("file://test");
Expand Down
Loading