Skip to content

Commit

Permalink
fix: throw error if maxLength is less than zero
Browse files Browse the repository at this point in the history
  • Loading branch information
robertu7 committed Jun 13, 2024
1 parent f63c575 commit c267518
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/transformers/normalize.ts
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ export const truncateLinkText = (
truncatedText = text.replace(/(^\w+:|^)\/\//, '')
}

if (maxLength === 0) {
if (maxLength <= 0) {
throw new Error('maxLength must be greater than 0')
}

Expand Down

0 comments on commit c267518

Please sign in to comment.