From c2b5b882beea2528907854ef1c10b3b2c2fcc940 Mon Sep 17 00:00:00 2001 From: Elliot Winkler Date: Mon, 16 Oct 2023 21:33:45 -0600 Subject: [PATCH] Refactor further --- src/assert.ts | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/src/assert.ts b/src/assert.ts index dacab012d..5892ebbfc 100644 --- a/src/assert.ts +++ b/src/assert.ts @@ -32,12 +32,8 @@ function isConstructable( * period if it is not `undefined` or `null`; otherwise an empty string. */ function getErrorMessageWithoutTrailingPeriod(error: unknown): string { - const message = getErrorMessage(error); - // We'll add our own period. - return message.replace(/\.$/, ''); - - return message; + return getErrorMessage(error).replace(/\.$/u, ''); } /**