auto-fixed prefer-const violation

This commit is contained in:
Johannes
2022-06-08 17:49:21 +02:00
parent aa23a0dbb7
commit 0656d21d11
862 changed files with 6489 additions and 6489 deletions

View File

@@ -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;

View File

@@ -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) {