mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Birthstone Command
This commit is contained in:
@@ -20,6 +20,8 @@ module.exports = class Util {
|
||||
|
||||
static list(arr, conj = 'and') {
|
||||
const len = arr.length;
|
||||
if (len === 0) return '';
|
||||
if (len === 1) return arr[0];
|
||||
return `${arr.slice(0, -1).join(', ')}${len > 1 ? `${len > 2 ? ',' : ''} ${conj} ` : ''}${arr.slice(-1)}`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user