diff --git a/src/utils/utils.ts b/src/utils/utils.ts index 0eaec28..93e5e85 100644 --- a/src/utils/utils.ts +++ b/src/utils/utils.ts @@ -299,7 +299,7 @@ const generateValueWithAddedSuggestion = ( * @param text - plain text that will be added to the part * @param positionOffset - position offset from the very beginning of text */ -const generatePlainTextPart = (text: string = '', positionOffset = 0): Part => ({ +const generatePlainTextPart = (text: string, positionOffset = 0): Part => ({ text, position: { start: positionOffset, @@ -369,10 +369,13 @@ const getMentionDataFromRegExMatchResult = ([, original, trigger, name, id]: Reg * @param positionOffset - offset from the very beginning of plain text */ const parseValue = ( - value: string = '', + value: string, partTypes: PartType[], positionOffset = 0, ): { plainText: string; parts: Part[] } => { + if (value == null) { + value = ''; + } let plainText = ''; let parts: Part[] = [];