Skip to content

Commit 1fe3fe0

Browse files
fix lints
1 parent 8d3817e commit 1fe3fe0

File tree

1 file changed

+14
-14
lines changed

1 file changed

+14
-14
lines changed

src/jio-navbar.ts

Lines changed: 14 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ export class Navbar extends LitElement {
102102
}
103103

104104
private getDocsUrl(originalPath: string): string {
105-
const [cleanPath, query, hash] = originalPath.replace(/^https?:\/\/[^\/]+/, '').split(/[?#]/);
105+
const [cleanPath, query, hash] = originalPath.replace(/^https?:\/\/[^/]+/, '').split(/[?#]/);
106106

107107
const docMappings: Record<string, {path: string, versioned: boolean}> = {
108108
// User Guide sections (versioned)
@@ -303,26 +303,26 @@ export class Navbar extends LitElement {
303303
] as Array<NavbarItemLink>;
304304

305305
const menuItemsHtml = menuItems.map((menuItem, idx) => {
306-
let body;
307306
if (menuItem.link && Array.isArray(menuItem.link)) {
308-
body = this.renderNavItemDropdown(menuItem, idx, this.visibleMenu === idx);
309-
} else {
310-
body = html`<li class="nav-item">${this.renderNavItemLink(menuItem)}</li>`;
307+
return this.renderNavItemDropdown(menuItem, idx, this.visibleMenu === idx);
311308
}
312-
return body;
309+
return html`<li class="nav-item">${this.renderNavItemLink(menuItem)}</li>`;
313310
});
314311

315312
const versionSelector = this.docVersions.length > 1 ? html`
316313
<div class="version-selector">
317314
<select @change=${this._handleVersionChange}>
318-
${this.docVersions.map(v => html`
319-
<option
320-
value=${v.version}
321-
?selected=${v.version === this.currentDocVersion}
322-
>
323-
${v.label} (${v.version})
324-
</option>
325-
`)}
315+
${this.docVersions.map(version => ({
316+
version,
317+
html: html`
318+
<option
319+
value=${version.version}
320+
?selected=${version.version === this.currentDocVersion}
321+
>
322+
${version.label} (${version.version})
323+
</option>
324+
`
325+
})).map(v => v.html)}
326326
</select>
327327
</div>
328328
` : nothing;

0 commit comments

Comments
 (0)