-
Notifications
You must be signed in to change notification settings - Fork 22
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #174 from apiaryio/166-deprecate-isvalid
feat: adds "isValid" property on the validation results
- Loading branch information
Showing
7 changed files
with
285 additions
and
267 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
// Returns a boolean indicating whether a given validation result | ||
// concludes two HTTP messages as valid (matching). | ||
// Separated into its own util only to be used in both next and legacy API. | ||
// TODO Move to "validateMessage" after legacy "gavel.validate()" removal. | ||
function isValid(validationResult) { | ||
return Object.values(validationResult).every((resultGroup) => { | ||
return resultGroup.results.every((result) => result.severity !== 'error'); | ||
}); | ||
} | ||
|
||
module.exports = { isValid }; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.