From 065d8591948f8d83bf9a214522607b5fd888fb48 Mon Sep 17 00:00:00 2001 From: Awesome Code Date: Fri, 24 May 2024 07:16:47 +0000 Subject: [PATCH] Auto corrected by following Format Typescript Code --- src/node-version.ts | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/node-version.ts b/src/node-version.ts index d08a5d2..9ee05f9 100644 --- a/src/node-version.ts +++ b/src/node-version.ts @@ -34,14 +34,16 @@ class NodeVersion { path.join(Configuration.rootPath, ".nvmrc"), "utf-8", ); - } else if (isValidFileSync(path.join(Configuration.rootPath, "package.json"))) { + } else if ( + isValidFileSync(path.join(Configuration.rootPath, "package.json")) + ) { const packageFileContent = fs.readFileSync( path.join(Configuration.rootPath, "package.json"), "utf-8", ); - const packageJson = JSON.parse(packageFileContent) + const packageJson = JSON.parse(packageFileContent); if (packageJson.engines && packageJson.engines.node) { - version = packageJson.engines.node.replace(/[^0-9.]/g, ''); + version = packageJson.engines.node.replace(/[^0-9.]/g, ""); } } if (!version) { @@ -70,14 +72,16 @@ class NodeVersion { path.join(Configuration.rootPath, ".nvmrc"), "utf-8", ); - } else if (await isValidFile(path.join(Configuration.rootPath, "package.json"))) { + } else if ( + await isValidFile(path.join(Configuration.rootPath, "package.json")) + ) { const packageFileContent = await promisesFs.readFile( path.join(Configuration.rootPath, "package.json"), "utf-8", ); - const packageJson = JSON.parse(packageFileContent) + const packageJson = JSON.parse(packageFileContent); if (packageJson.engines && packageJson.engines.node) { - version = packageJson.engines.node.replace(/[^0-9.]/g, ''); + version = packageJson.engines.node.replace(/[^0-9.]/g, ""); } } if (!version) {