From 31f648609b702e0c9cb11dc0453b365db037ffa9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Philip=20J=C3=A4genstedt?= Date: Fri, 31 Jan 2020 16:22:10 +0700 Subject: [PATCH] Fix nits/typos from "Allow specs to be represented by a simple string" https://github.com/w3c/browser-specs/pull/3 --- lint.js | 10 +++++----- test/lint.js | 2 +- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/lint.js b/lint.js index a3670f4b..26c30560 100644 --- a/lint.js +++ b/lint.js @@ -7,9 +7,9 @@ const ajv = new Ajv(); // When an entry is invalid, the schema validator returns one error for each // "oneOf" option and one error on overall "oneOf" problem. This is confusing -// for humans. the following function improves the error being returned. +// for humans. The following function improves the error being returned. const clarifyErrors = errors => { - if (!errors || (errors.length < 2)) { + if (!errors || errors.length < 2) { return errors; } @@ -23,8 +23,8 @@ const clarifyErrors = errors => { } // Otherwise, if second error is a type error for second oneOf choice, - // it means the itme is actually a string that represents an invalid URL, - // which the first error should capture + // it means the item is actually a string that represents an invalid URL, + // which the first error should capture. if (errors[1].schemaPath === "#/items/oneOf/1/type") { return [errors[0]]; } @@ -128,4 +128,4 @@ else { // Code imported to another JS module, export lint functions module.exports.lintStr = lintStr; module.exports.lint = lint; -} \ No newline at end of file +} diff --git a/test/lint.js b/test/lint.js index 14d63881..1d81f876 100644 --- a/test/lint.js +++ b/test/lint.js @@ -83,4 +83,4 @@ describe("Linter", () => { /^specs\[0\] should not have additional property 'invalid'$/); }); }); -}); \ No newline at end of file +});