From c267518b8a0ed00e1585f34d23244a24e3696948 Mon Sep 17 00:00:00 2001 From: robertu <4065233+robertu7@users.noreply.github.com> Date: Thu, 13 Jun 2024 21:44:03 +0800 Subject: [PATCH] fix: throw error if maxLength is less than zero --- src/transformers/normalize.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/transformers/normalize.ts b/src/transformers/normalize.ts index 9b6aeaa..85e24ee 100644 --- a/src/transformers/normalize.ts +++ b/src/transformers/normalize.ts @@ -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') }