From 9f92c32af21bb7f3d2ec8895338a6c248f2529b2 Mon Sep 17 00:00:00 2001 From: Joseph Garrone Date: Thu, 14 May 2020 02:05:09 +0200 Subject: [PATCH] update --- src/tools/getProjectRoot.ts | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/src/tools/getProjectRoot.ts b/src/tools/getProjectRoot.ts index ff45ab4..dcb2b83 100644 --- a/src/tools/getProjectRoot.ts +++ b/src/tools/getProjectRoot.ts @@ -1,10 +1,8 @@ - - import * as fs from "fs"; import * as path from "path"; -function getProjectRootRec(dirPath: string): string{ - if( fs.existSync(path.join(dirPath, "package.json")) ){ +function getProjectRootRec(dirPath: string): string { + if (fs.existsSync(path.join(dirPath, "package.json"))) { return dirPath; } return getProjectRootRec(path.join(dirPath, "..")) @@ -12,9 +10,9 @@ function getProjectRootRec(dirPath: string): string{ let result: string | undefined = undefined; -export function getProjectRoot(): string{ +export function getProjectRoot(): string { - if( result !== undefined ){ + if (result !== undefined) { return result; }