X-Git-Url: https://git.piment-noir.org/?a=blobdiff_plain;f=src%2Fperformance%2FPerformanceStatistics.ts;h=265cb6c963918b1a3970a95e5822742f3202c0d4;hb=8a4f882a2486682b72195ad978ec1d81604b452b;hp=6363be1c6b2196842b49dc1140ca9887d5b4b385;hpb=1091427efe95a8f1733282589dc1794a5be7e785;p=e-mobility-charging-stations-simulator.git diff --git a/src/performance/PerformanceStatistics.ts b/src/performance/PerformanceStatistics.ts index 6363be1c..265cb6c9 100644 --- a/src/performance/PerformanceStatistics.ts +++ b/src/performance/PerformanceStatistics.ts @@ -5,7 +5,7 @@ import type { URL } from 'node:url' import { parentPort } from 'node:worker_threads' import { secondsToMilliseconds } from 'date-fns' -import { mean, median } from 'rambda' +import { is, mean, median } from 'rambda' import { BaseError } from '../exception/index.js' import { @@ -107,7 +107,7 @@ export class PerformanceStatistics { try { performance.measure(name, markId) } catch (error) { - if (error instanceof Error && error.message.includes('performance mark has not been set')) { + if (is(Error, error) && error.message.includes('performance mark has not been set')) { /* Ignore */ } else { throw error