From 54b50bbaa626c1b783ec67e17afa4ae3a8223f6a Mon Sep 17 00:00:00 2001 From: Yury Date: Sun, 15 Aug 2021 13:16:28 +0300 Subject: [PATCH] fix: duplicate array decoration --- src/ApiTypeDocument.js | 91 +++++++++++++++++++----------------------- 1 file changed, 41 insertions(+), 50 deletions(-) diff --git a/src/ApiTypeDocument.js b/src/ApiTypeDocument.js index 19acae4..24b6955 100644 --- a/src/ApiTypeDocument.js +++ b/src/ApiTypeDocument.js @@ -655,57 +655,48 @@ export class ApiTypeDocument extends PropertyDocumentMixin(LitElement) { /** * @return {TemplateResult} Templates for object properties */ - _arrayTemplate() { + _arrayTemplate() { const items = this._computeArrayProperties(this._resolvedType) || []; - return html` - ${this.hasParentType - ? html`` - : html`Array of:`} - -
- ${items.map( - (item) => html` - ${item.isShape - ? html`` - : ''} - ${item.isType - ? html`` - : ''} - ` - )} -
- `; + const documents = items.map( + (item) => html` + ${item.isShape + ? html`` + : ''} + ${item.isType + ? html`` + : ''} + ` + ); + if (!this.hasParentType) { + return html` + Array of: +
+ ${documents} +
+ `; + } + return html`${documents}`; } /**