mirror of
https://github.com/mountain-loop/yaak.git
synced 2026-03-20 00:23:58 +01:00
Export multiple workspaces
This commit is contained in:
@@ -5,6 +5,16 @@ export function pluralize(word: string, count: number): string {
|
||||
return `${word}s`;
|
||||
}
|
||||
|
||||
export function count(word: string, count: number): string {
|
||||
export function count(
|
||||
word: string,
|
||||
count: number,
|
||||
opt: { omitSingle?: boolean; noneWord?: string } = {},
|
||||
): string {
|
||||
if (opt.omitSingle && count === 1) {
|
||||
return word;
|
||||
}
|
||||
if (opt.noneWord && count === 0) {
|
||||
return opt.noneWord;
|
||||
}
|
||||
return `${count} ${pluralize(word, count)}`;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user