From 9ef75e34cd01ecd7f75ce08ca7e4719d3c2b858b Mon Sep 17 00:00:00 2001 From: =?utf8?q?J=C3=A9r=C3=B4me=20Benoit?= Date: Wed, 25 Aug 2021 23:02:05 +0200 Subject: [PATCH] Fix regexp compliancy for sonar static analyzer MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Jérôme Benoit --- src/utils/performance-storage/JSONFileStorage.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/utils/performance-storage/JSONFileStorage.ts b/src/utils/performance-storage/JSONFileStorage.ts index af709d91..4b5085cb 100644 --- a/src/utils/performance-storage/JSONFileStorage.ts +++ b/src/utils/performance-storage/JSONFileStorage.ts @@ -10,7 +10,7 @@ export class JSONFileStorage extends Storage { } public storePerformanceStatistics(performanceStatistics: Statistics): void { - const performanceJSONFilePath = path.join(path.resolve(__dirname, '../../../'), this.storageURI.pathname.replace(/^\/|\/$/g, '')); + const performanceJSONFilePath = path.join(path.resolve(__dirname, '../../../'), this.storageURI.pathname.replace(/(?:^\/)|(?:\/$)/g, '')); fs.appendFile(performanceJSONFilePath, JSON.stringify(performanceStatistics, null, 2), 'utf8', (err) => { if (err) { FileUtils.handleFileException(this.logPrefix, 'Performance measurements', performanceJSONFilePath, err); -- 2.34.1