mirror of
https://github.com/Microsoft/vscode
synced 2024-10-13 06:48:17 +00:00
make URI#from more strict and URI#with more clear wrt schme-enforcement, #56108
This commit is contained in:
parent
4fa87ebca6
commit
48e118bb84
|
@ -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,
|
||||
|
|
10
src/vs/monaco.d.ts
vendored
10
src/vs/monaco.d.ts
vendored
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue