Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rework Uri.parse and Uri.toString #83060

Merged
merged 23 commits into from
Oct 24, 2019
Merged
Changes from all commits
Commits
Show all changes
23 commits
Select commit Hold shift + click to select a range
359c17a
custom encode/decode logic
jrieken Oct 22, 2019
3e0ded9
keep input (for toString) when using URI.parse, URI.file uses now URI…
jrieken Oct 22, 2019
40e3b80
tweak test for less encoding, restore URI.toString(true) behaviour, e…
jrieken Oct 22, 2019
2166211
Merge branch 'master' into joh/uri-parse
jrieken Oct 23, 2019
a7c1ece
adjust tests that relied on URI.toJSON or URI.toString output
jrieken Oct 23, 2019
bea884b
polish
jrieken Oct 23, 2019
96aee26
add tests that compare URI against nodejs/standard URL
jrieken Oct 23, 2019
612fdf5
fix missing #-encode in URI.file factory
jrieken Oct 23, 2019
50d97cf
tweak tests, make sure nodejs tests are platform aware
jrieken Oct 23, 2019
cc7fdb6
more tests, check more sample against standard url, make sure we norm…
jrieken Oct 23, 2019
989f98a
tweak nodejs compare tests so that they work on windows
jrieken Oct 23, 2019
59cd7f5
cache regular expression, inline string constants
jrieken Oct 23, 2019
6f59bbd
fix drive letter regexp issue
jrieken Oct 23, 2019
94d6dfd
more test tweak...
jrieken Oct 23, 2019
11e2013
and more tweaks...
jrieken Oct 23, 2019
5569584
Merge branch 'master' into joh/uri-parse
jrieken Oct 24, 2019
67c8c94
node nodejs specific test tweaks
jrieken Oct 24, 2019
bbb516c
polish, extract util functions, fix issue with overeager hex detection
jrieken Oct 24, 2019
e0617e5
some more test utils
jrieken Oct 24, 2019
666ad41
add tests from old bugs that have been resolved "as designed"
jrieken Oct 24, 2019
175ab4a
don't warn when fixing missing scheme, just do it... bring back stric…
jrieken Oct 24, 2019
92292f4
remove encodeURI(uri.toString(true)) workarounds
jrieken Oct 24, 2019
10fe086
fix test failure after more strict parse in markdown convert
jrieken Oct 24, 2019
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
30 changes: 29 additions & 1 deletion src/vs/base/common/strings.ts
Original file line number Diff line number Diff line change
@@ -338,6 +338,34 @@ export function compareIgnoreCase(a: string, b: string): number {
}
}

/**
* [0-9]
*/
export function isAsciiDigit(code: number): boolean {
return code >= CharCode.Digit0 && code <= CharCode.Digit9;
}

/**
* [a-f]
*/
export function isLowerAsciiHex(code: number): boolean {
return code >= CharCode.a && code <= CharCode.f;
}

/**
* [A-F]
*/
export function isUpperAsciiHex(code: number): boolean {
return code >= CharCode.A && code <= CharCode.F;
}

/**
* [0-9a-fA-F]
*/
export function isAsciiHex(code: number): boolean {
return isAsciiDigit(code) || isLowerAsciiHex(code) || isUpperAsciiHex(code);
}

export function isLowerAsciiLetter(code: number): boolean {
return code >= CharCode.a && code <= CharCode.z;
}
@@ -346,7 +374,7 @@ export function isUpperAsciiLetter(code: number): boolean {
return code >= CharCode.A && code <= CharCode.Z;
}

function isAsciiLetter(code: number): boolean {
export function isAsciiLetter(code: number): boolean {
return isLowerAsciiLetter(code) || isUpperAsciiLetter(code);
}

Loading