提交 48e118bb 编写于 作者: J Johannes Rieken

make URI#from more strict and URI#with more clear wrt schme-enforcement, #56108

上级 4fa87ebc
......@@ -191,7 +191,7 @@ export default class URI implements UriComponents {
// ---- modify to new -------------------------
public with(change: { scheme?: string; authority?: string; path?: string; query?: string; fragment?: string }): URI {
public with(change: { scheme?: string; authority?: string | null; path?: string | null; query?: string | null; fragment?: string | null }): URI {
if (!change) {
return this;
......@@ -307,7 +307,7 @@ export default class URI implements UriComponents {
return new _URI('file', authority, path, _empty, _empty);
}
public static from(components: { scheme?: string; authority?: string; path?: string; query?: string; fragment?: string }): URI {
public static from(components: { scheme: string; authority?: string; path?: string; query?: string; fragment?: string }): URI {
return new _URI(
components.scheme,
components.authority,
......
......@@ -163,10 +163,10 @@ declare namespace monaco {
readonly fsPath: string;
with(change: {
scheme?: string;
authority?: string;
path?: string;
query?: string;
fragment?: string;
authority?: string | null;
path?: string | null;
query?: string | null;
fragment?: string | null;
}): Uri;
/**
* Creates a new Uri from a string, e.g. `http://www.msft.com/some/path`,
......@@ -199,7 +199,7 @@ declare namespace monaco {
*/
static file(path: string): Uri;
static from(components: {
scheme?: string;
scheme: string;
authority?: string;
path?: string;
query?: string;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册