This commit is contained in:
Simon Knott 2025-02-12 14:51:57 +01:00
parent b20e36fb5f
commit 89ff7fa804
No known key found for this signature in database
GPG key ID: 8CEDC00028084AEC

View file

@ -20,8 +20,10 @@ function stripAnsiEscapes(str: string): string {
}
function enumerate(items: string[]) {
if (items.length === 0) return '';
if (items.length === 1) return items[0];
if (items.length === 0)
return '';
if (items.length === 1)
return items[0];
return items.slice(0, -1).join(', ') + ' and ' + items[items.length - 1];
}