source: trip-planner-front/node_modules/ajv/dist/compile/validate/applicability.js

Last change on this file was 6a3a178, checked in by Ema <ema_spirova@…>, 3 years ago

initial commit

  • Property mode set to 100644
File size: 853 bytes
RevLine 
[6a3a178]1"use strict";
2Object.defineProperty(exports, "__esModule", { value: true });
3exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0;
4function schemaHasRulesForType({ schema, self }, type) {
5 const group = self.RULES.types[type];
6 return group && group !== true && shouldUseGroup(schema, group);
7}
8exports.schemaHasRulesForType = schemaHasRulesForType;
9function shouldUseGroup(schema, group) {
10 return group.rules.some((rule) => shouldUseRule(schema, rule));
11}
12exports.shouldUseGroup = shouldUseGroup;
13function 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}
18exports.shouldUseRule = shouldUseRule;
19//# sourceMappingURL=applicability.js.map
Note: See TracBrowser for help on using the repository browser.