Skip to content

Commit

Permalink
Add @legobeat's suggestion to assert.ts
Browse files Browse the repository at this point in the history
Co-authored-by: legobeat <[email protected]>
  • Loading branch information
mcmire and legobeat authored Oct 17, 2023
1 parent a1bbff1 commit 55bc59e
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/assert.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,8 @@ function isConstructable(
function getErrorMessageWithoutTrailingPeriod(error: unknown): string {
const message = getErrorMessage(error);

if (message.endsWith('.')) {
// We'll add our own period.
return message.slice(0, -1);
}
// We'll add our own period.
return message.replace(/\.$/, '');

return message;
}
Expand Down

0 comments on commit 55bc59e

Please sign in to comment.