Last change
on this file since 84d0fbb was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago |
initial commit
|
-
Property mode
set to
100644
|
File size:
853 bytes
|
Line | |
---|
1 | "use strict";
|
---|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
---|
3 | exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0;
|
---|
4 | function schemaHasRulesForType({ schema, self }, type) {
|
---|
5 | const group = self.RULES.types[type];
|
---|
6 | return group && group !== true && shouldUseGroup(schema, group);
|
---|
7 | }
|
---|
8 | exports.schemaHasRulesForType = schemaHasRulesForType;
|
---|
9 | function shouldUseGroup(schema, group) {
|
---|
10 | return group.rules.some((rule) => shouldUseRule(schema, rule));
|
---|
11 | }
|
---|
12 | exports.shouldUseGroup = shouldUseGroup;
|
---|
13 | function shouldUseRule(schema, rule) {
|
---|
14 | var _a;
|
---|
15 | return (schema[rule.keyword] !== undefined ||
|
---|
16 | ((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined)));
|
---|
17 | }
|
---|
18 | exports.shouldUseRule = shouldUseRule;
|
---|
19 | //# sourceMappingURL=applicability.js.map |
---|
Note:
See
TracBrowser
for help on using the repository browser.