From b83aa51280dc4b499ceb06fc7383b4855861c79c Mon Sep 17 00:00:00 2001 From: jneira Date: Wed, 13 Oct 2021 23:48:37 +0200 Subject: [PATCH] Fix some new ts errors/warnings --- src/docsBrowser.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/docsBrowser.ts b/src/docsBrowser.ts index 61d685f5..01ed532a 100644 --- a/src/docsBrowser.ts +++ b/src/docsBrowser.ts @@ -47,7 +47,7 @@ export namespace DocsBrowser { enableScripts: true, }); - const encoded = encodeURIComponent(JSON.stringify({ hackageUri: hackageUri, inWebView: true })); + const encoded = encodeURIComponent(JSON.stringify({ hackageUri, inWebView: true })); const hackageCmd = 'command:haskell.openDocumentationOnHackage?' + encoded; const bytes = await workspace.fs.readFile(Uri.parse(localPath)); @@ -146,7 +146,7 @@ export namespace DocsBrowser { /\[(.+)\]\((file:.+\/doc\/(?:.*html\/libraries\/)?([^\/]+)\/(?:.*\/)?(.+\.html#?.*))\)/gi, (all, title, localPath, packageName, fileAndAnchor) => { let hackageUri: string; - if (title == 'Documentation') { + if (title === 'Documentation') { hackageUri = `https://hackage.haskell.org/package/${packageName}/docs/${fileAndAnchor}`; const encoded = encodeURIComponent(JSON.stringify({ title, localPath, hackageUri })); let cmd: string; @@ -156,7 +156,7 @@ export namespace DocsBrowser { cmd = 'command:haskell.showDocumentation?' + encoded; } return `[${title}](${cmd})`; - } else if (title == 'Source') { + } else if (title === 'Source') { hackageUri = `https://hackage.haskell.org/package/${packageName}/docs/src/${fileAndAnchor.replace( /-/gi, '.'