Skip to content

Commit

Permalink
Refactor further
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmire committed Oct 17, 2023
1 parent 55bc59e commit c2b5b88
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions src/assert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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, '');
}

/**
Expand Down

0 comments on commit c2b5b88

Please sign in to comment.