From: Jérôme Benoit Date: Wed, 25 Aug 2021 21:02:05 +0000 (+0200) Subject: Fix regexp compliancy for sonar static analyzer X-Git-Tag: v1.0.43~1 X-Git-Url: https://git.piment-noir.org/?a=commitdiff_plain;h=9ef75e34cd01ecd7f75ce08ca7e4719d3c2b858b;p=e-mobility-charging-stations-simulator.git Fix regexp compliancy for sonar static analyzer Signed-off-by: Jérôme Benoit --- 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);