[html] Follow Link in Multi Root Workspace. Fixes #38469

This commit is contained in:
Martin Aeschlimann
2017-11-20 13:36:45 +01:00
parent e1eeccd55c
commit ce11eb88b3
3 changed files with 60 additions and 5 deletions

View File

@@ -41,6 +41,17 @@ export function startsWith(haystack: string, needle: string): boolean {
return true;
}
export function endsWith(haystack: string, needle: string): boolean {
let diff = haystack.length - needle.length;
if (diff > 0) {
return haystack.indexOf(needle, diff) === diff;
} else if (diff === 0) {
return haystack === needle;
} else {
return false;
}
}
export function repeat(value: string, count: number) {
var s = '';
while (count > 0) {