From 9400803a7dd0809d92c01d654e3fa75a01cb747e Mon Sep 17 00:00:00 2001 From: tgreyuk Date: Wed, 5 May 2021 23:38:43 +0100 Subject: [PATCH] fix: Add space between 'Const' and signature name (#220) --- .../src/resources/helpers/signature-title.ts | 5 ++--- .../test/specs/__snapshots__/signatures.spec.ts.snap | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/packages/typedoc-plugin-markdown/src/resources/helpers/signature-title.ts b/packages/typedoc-plugin-markdown/src/resources/helpers/signature-title.ts index dd051f233..85382817f 100644 --- a/packages/typedoc-plugin-markdown/src/resources/helpers/signature-title.ts +++ b/packages/typedoc-plugin-markdown/src/resources/helpers/signature-title.ts @@ -1,5 +1,4 @@ import { SignatureReflection } from 'typedoc'; - import { memberSymbol } from './member-symbol'; import { type } from './type'; @@ -14,8 +13,8 @@ export function signatureTitle( md.push(`${memberSymbol.call(this)} `); } - if (this.parent && this.parent.flags) { - md.push(this.parent.flags.map((flag) => `\`${flag}\``).join(' ')); + if (this.parent && this.parent.flags?.length > 0) { + md.push(this.parent.flags.map((flag) => `\`${flag}\``).join(' ') + ' '); } if (accessor) { diff --git a/packages/typedoc-plugin-markdown/test/specs/__snapshots__/signatures.spec.ts.snap b/packages/typedoc-plugin-markdown/test/specs/__snapshots__/signatures.spec.ts.snap index 463a7d2a1..e5e00b9a1 100644 --- a/packages/typedoc-plugin-markdown/test/specs/__snapshots__/signatures.spec.ts.snap +++ b/packages/typedoc-plugin-markdown/test/specs/__snapshots__/signatures.spec.ts.snap @@ -136,7 +136,7 @@ Return comments `; exports[`Signatures: should compile signature with a flag' 1`] = ` -"▸ \`Private\`**privateFunction**(): *string* +"▸ \`Private\` **privateFunction**(): *string* **Returns:** *string* @@ -221,7 +221,7 @@ This is a function with rest parameter. `; exports[`Signatures: should compile signature with type params' 1`] = ` -"▸ \`Const\`**functionWithTypeParams**(): *boolean* +"▸ \`Const\` **functionWithTypeParams**(): *boolean* #### Type parameters