mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-03 23:06:49 +01:00
auto-fixed prefer-const violation
This commit is contained in:
@@ -8,7 +8,7 @@ import { RuntimeEnvironment } from '../jsonServer';
|
||||
|
||||
export function formatError(message: string, err: any): string {
|
||||
if (err instanceof Error) {
|
||||
let error = <Error>err;
|
||||
const error = <Error>err;
|
||||
return `${message}: ${error.message}\n${error.stack}`;
|
||||
} else if (typeof err === 'string') {
|
||||
return `${message}: ${err}`;
|
||||
@@ -47,7 +47,7 @@ export function runSafe<T, E>(runtime: RuntimeEnvironment, func: () => T, errorV
|
||||
resolve(cancelValue());
|
||||
} else {
|
||||
try {
|
||||
let result = func();
|
||||
const result = func();
|
||||
if (token.isCancellationRequested) {
|
||||
resolve(cancelValue());
|
||||
return;
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
* Determines if haystack ends with needle.
|
||||
*/
|
||||
export function endsWith(haystack: string, needle: string): boolean {
|
||||
let diff = haystack.length - needle.length;
|
||||
const diff = haystack.length - needle.length;
|
||||
if (diff > 0) {
|
||||
return haystack.lastIndexOf(needle) === diff;
|
||||
} else if (diff === 0) {
|
||||
|
||||
Reference in New Issue
Block a user