From c5fe109d6521034ff0e49f08e9de8bf03ac4ba67 Mon Sep 17 00:00:00 2001 From: Dmytro Bogatov <dmytro@dbogatov.org> Date: Thu, 25 Jun 2020 23:58:56 -0400 Subject: [PATCH] Fixes. Start README. --- README.md | 8 ++++++++ src/inspector.ts | 2 +- src/result.ts | 2 +- test/process-url.ts | 2 +- 4 files changed, 11 insertions(+), 3 deletions(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..2095337 --- /dev/null +++ b/README.md @@ -0,0 +1,8 @@ +# Broken Links Inspector + +[](https://www.npmjs.com/package/broken-links-inspector]) + +[](https://git.dbogatov.org/dbogatov/broken-links-inspector/-/commits/master) + +[](https://git.dbogatov.org/dbogatov/broken-links-inspector/-/commits/master) + diff --git a/src/inspector.ts b/src/inspector.ts index cc08fc0..9a27996 100644 --- a/src/inspector.ts +++ b/src/inspector.ts @@ -50,7 +50,7 @@ export class AxiosHttpClient implements IHttpClient { } else if (!error.response) { throw new HttpClientFailure(false, -1) } else { - if (this.acceptedCodes.some(code => code == error.response?.status)) { + if (this.acceptedCodes.some(code => code == error.response!.status)) { return "" } else { throw new HttpClientFailure(false, error.response.status) diff --git a/src/result.ts b/src/result.ts index 4662159..bad7d1c 100644 --- a/src/result.ts +++ b/src/result.ts @@ -22,7 +22,7 @@ export class Result { } if (this.pages.has(parent)) { - this.pages.get(parent)?.push(completedCheck) + this.pages.get(parent)!.push(completedCheck) } else { this.pages.set(parent, [completedCheck]) } diff --git a/test/process-url.ts b/test/process-url.ts index ebf9ace..282ad77 100644 --- a/test/process-url.ts +++ b/test/process-url.ts @@ -219,7 +219,7 @@ describe("process mock URL", function () { unhook_intercept(); - result.report(new JUnitReporter(true)) + result.report(new JUnitReporter()) let lines = log.split(/\r?\n/) -- GitLab