address comment

This commit is contained in:
Yury Semikhatsky 2024-06-17 17:00:43 -07:00
parent 9f3057da6a
commit 1e47805303

View file

@ -75,7 +75,7 @@ export function cacheNormalizedWhitespaces() {
export function normalizeWhiteSpace(text: string): string { export function normalizeWhiteSpace(text: string): string {
let result = normalizedWhitespaceCache?.get(text); let result = normalizedWhitespaceCache?.get(text);
if (!result) { if (result === undefined) {
result = text.replace(/\u200b/g, '').trim().replace(/\s+/g, ' '); result = text.replace(/\u200b/g, '').trim().replace(/\s+/g, ' ');
normalizedWhitespaceCache?.set(text, result); normalizedWhitespaceCache?.set(text, result);
} }