Skip to content

Commit bd81d3c

Browse files
authored
Fix bug in pluralize helper method
Correctly handle the zero case
1 parent 4e5abee commit bd81d3c

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

extensions/ql-vscode/src/helpers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,5 +590,5 @@ export async function* walkDirectory(dir: string): AsyncIterableIterator<string>
590590
* Example: Returns "N repository" if N is one, "N repositories" otherwise.
591591
*/
592592
export function pluralize(numItems: number | undefined, singular: string, plural: string): string {
593-
return numItems ? `${numItems} ${numItems === 1 ? singular : plural}` : '';
593+
return numItems !== undefined ? `${numItems} ${numItems === 1 ? singular : plural}` : '';
594594
}

0 commit comments

Comments
 (0)