Birthstone Command

This commit is contained in:
Dragon Fire
2020-04-12 09:26:00 -04:00
parent 356aeb71bb
commit ca65c960da
5 changed files with 77 additions and 2 deletions
+2
View File
@@ -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)}`;
}