From a774c879d4cf08a76fc404771883807d27465265 Mon Sep 17 00:00:00 2001 From: MCMXC <16797721+mcmxcdev@users.noreply.github.com> Date: Thu, 7 Dec 2023 22:37:37 -0700 Subject: refactor: code cleanup (#1476) - auto update `settings.json` due to new vscode version - replace deprecated `e.keyCode` with `e.key` - fix various code snippets with sonarlint and other lint plugins --- src/helpers/service-helpers.ts | 2 +- src/helpers/update-helpers.ts | 2 +- src/helpers/userAgent-helpers.ts | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) (limited to 'src/helpers') diff --git a/src/helpers/service-helpers.ts b/src/helpers/service-helpers.ts index 678d5024f..f27d53285 100644 --- a/src/helpers/service-helpers.ts +++ b/src/helpers/service-helpers.ts @@ -12,7 +12,7 @@ export function removeServicePartitionDirectory( const servicePartition = getServicePartitionsDirectory( `${addServicePrefix ? 'service-' : ''}${id}`, ); - return removeSync(servicePartition); + removeSync(servicePartition); } export async function getServiceIdsFromPartitions() { diff --git a/src/helpers/update-helpers.ts b/src/helpers/update-helpers.ts index 9a36850fc..ca541c4b0 100644 --- a/src/helpers/update-helpers.ts +++ b/src/helpers/update-helpers.ts @@ -5,7 +5,7 @@ export function getFerdiumVersion( currentLocation: string, ferdiumVersion: string, ): string { - const matches = currentLocation?.match(/version=([^&]*)/); + const matches = currentLocation.match(/version=([^&]*)/); if (matches !== null) { return `v${matches[1]}`; } diff --git a/src/helpers/userAgent-helpers.ts b/src/helpers/userAgent-helpers.ts index bc99fbc52..42e3a9851 100644 --- a/src/helpers/userAgent-helpers.ts +++ b/src/helpers/userAgent-helpers.ts @@ -13,7 +13,7 @@ import { function macOS() { const version = macosVersion() ?? ''; let cpuName = cpus()[0].model.split(' ')[0]; - if (cpuName && /\(/.test(cpuName)) { + if (cpuName.includes('(')) { // eslint-disable-next-line prefer-destructuring cpuName = cpuName.split('(')[0]; } -- cgit v1.2.3-54-g00ecf