Skip to content

Commit c8b47ef

Browse files
committed
The if keyword doesn't branch
1 parent d1381ce commit c8b47ef

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/coverage-util.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ export const astToCoverageMap = (compiledSchema, schemaPath, schemaNodes) => {
7878
fileCoverage.statementMap[keywordLocation] = range;
7979
fileCoverage.s[keywordLocation] = 0;
8080

81-
if (annotationKeywords.has(keywordUri) || getKeyword(keywordUri).simpleApplicator) {
81+
if (nonBranchingKeywords.has(keywordUri) || getKeyword(keywordUri).simpleApplicator) {
8282
continue;
8383
}
8484

@@ -106,7 +106,7 @@ const positionToRange = (position) => {
106106
};
107107
};
108108

109-
const annotationKeywords = new Set([
109+
const nonBranchingKeywords = new Set([
110110
"https://json-schema.org/keyword/definitions",
111111
"https://json-schema.org/keyword/title",
112112
"https://json-schema.org/keyword/description",
@@ -115,7 +115,8 @@ const annotationKeywords = new Set([
115115
"https://json-schema.org/keyword/readOnly",
116116
"https://json-schema.org/keyword/writeOnly",
117117
"https://json-schema.org/keyword/examples",
118-
"https://json-schema.org/keyword/format"
118+
"https://json-schema.org/keyword/format",
119+
"https://json-schema.org/keyword/if"
119120
]);
120121

121122
/** @type API.registerSchema */

0 commit comments

Comments
 (0)