mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-12 01:23:31 +01:00
style: change how optionals are displayed
This commit is contained in:
@@ -11,10 +11,10 @@ type MethodResolvable = ApiMethodJSON | ApiMethodSignatureJSON;
|
||||
function getShorthandName(data: MethodResolvable) {
|
||||
return `${data.name}${data.optional ? '?' : ''}(${data.parameters.reduce((prev, cur, index) => {
|
||||
if (index === 0) {
|
||||
return `${prev}${cur.isOptional ? `[${cur.name}]` : cur.name}`;
|
||||
return `${prev}${cur.isOptional ? `${cur.name}?` : cur.name}`;
|
||||
}
|
||||
|
||||
return `${prev}, ${cur.isOptional ? `[${cur.name}]` : cur.name}`;
|
||||
return `${prev}, ${cur.isOptional ? `${cur.name}?` : cur.name}`;
|
||||
}, '')})`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user