mirror of
https://github.com/microsoft/vscode.git
synced 2025-12-22 03:09:13 +00:00
@import completion for css/scss/less. Fix #51331
This commit is contained in:
@@ -17,3 +17,17 @@ export function startsWith(haystack: string, needle: string): boolean {
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Determines if haystack ends with needle.
|
||||
*/
|
||||
export function endsWith(haystack: string, needle: string): boolean {
|
||||
let diff = haystack.length - needle.length;
|
||||
if (diff > 0) {
|
||||
return haystack.lastIndexOf(needle) === diff;
|
||||
} else if (diff === 0) {
|
||||
return haystack === needle;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user