Skip to content

Commit

Permalink
Fix some new ts errors/warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
jneira committed Oct 13, 2021
1 parent e71a957 commit b83aa51
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/docsBrowser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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));
Expand Down Expand Up @@ -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;
Expand All @@ -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,
'.'
Expand Down

0 comments on commit b83aa51

Please sign in to comment.