diff --git a/src/utils/Formatter.ts b/src/utils/Formatter.ts index f574b03..e872582 100644 --- a/src/utils/Formatter.ts +++ b/src/utils/Formatter.ts @@ -221,7 +221,7 @@ function ReassembleTokens(tokens: Token[], values: Record, opti continue; } - if(values == null) + if(!values) { if(options.RegenerateUnknownTokens) formatted += GenerateTokenText(token); @@ -312,7 +312,7 @@ function Stringify(token: Token, value: unknown): Nullable { * @param {FormatterOptions} [options] Any options for the formatter on how it should function * @returns {string} The formatted string with all tokens replaced with values */ -export function Format(message: string, values: Record, options?: FormatterOptions): string +export function Format(message: string, values?: Record | null, options?: FormatterOptions): string { // Exit early if there is nothing to format if(!message)