mirror of
https://github.com/discordjs/discord.js.git
synced 2026-03-09 16:13:31 +01:00
refactor: compare with undefined directly (#9191)
* refactor: compare with `undefined` directly * fix: lint
This commit is contained in:
@@ -13,7 +13,7 @@ export class DocumentedParam extends DocumentedItem<Param | ParameterReflection>
|
||||
name: data.name,
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing, no-param-reassign
|
||||
description: data.comment?.summary?.reduce((prev, curr) => (prev += curr.text), '').trim() || undefined,
|
||||
optional: data.flags.isOptional || typeof data.defaultValue !== 'undefined',
|
||||
optional: data.flags.isOptional || data.defaultValue !== undefined,
|
||||
default:
|
||||
(data.defaultValue === '...' ? undefined : data.defaultValue) ??
|
||||
(data.comment?.blockTags
|
||||
|
||||
@@ -86,7 +86,7 @@ export class DocumentedTypeDef extends DocumentedItem<DeclarationReflection | Ty
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing, no-param-reassign
|
||||
child.signatures?.[0]?.comment?.summary?.reduce((prev, curr) => (prev += curr.text), '').trim() ||
|
||||
undefined,
|
||||
optional: child.flags.isOptional || typeof child.defaultValue !== 'undefined',
|
||||
optional: child.flags.isOptional || child.defaultValue !== undefined,
|
||||
default:
|
||||
(child.defaultValue === '...' ? undefined : child.defaultValue) ??
|
||||
(child.comment?.blockTags
|
||||
@@ -131,7 +131,7 @@ export class DocumentedTypeDef extends DocumentedItem<DeclarationReflection | Ty
|
||||
name: param.name,
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-nullish-coalescing, no-param-reassign
|
||||
description: param.comment?.summary?.reduce((prev, curr) => (prev += curr.text), '').trim() || undefined,
|
||||
optional: param.flags.isOptional || typeof param.defaultValue !== 'undefined',
|
||||
optional: param.flags.isOptional || param.defaultValue !== undefined,
|
||||
default:
|
||||
(param.defaultValue === '...' ? undefined : param.defaultValue) ??
|
||||
(param.comment?.blockTags
|
||||
|
||||
Reference in New Issue
Block a user