Skip to content

Commit

Permalink
Fixed formatter logic
Browse files Browse the repository at this point in the history
  • Loading branch information
CEbbinghaus committed Jan 15, 2023
1 parent c398236 commit 991061d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/utils/Formatter.ts
Original file line number Diff line number Diff line change
Expand Up @@ -221,7 +221,7 @@ function ReassembleTokens(tokens: Token[], values: Record<string, unknown>, opti
continue;
}

if(values == null)
if(!values)
{
if(options.RegenerateUnknownTokens)
formatted += GenerateTokenText(token);
Expand Down Expand Up @@ -312,7 +312,7 @@ function Stringify(token: Token, value: unknown): Nullable<string> {
* @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<string, unknown>, options?: FormatterOptions): string
export function Format(message: string, values?: Record<string, unknown> | null, options?: FormatterOptions): string
{
// Exit early if there is nothing to format
if(!message)
Expand Down

0 comments on commit 991061d

Please sign in to comment.