Urara-Blog/node_modules/.pnpm-store/v3/files/22/bc3d683fb7fb83ff6ab4d537a975a22ef509b3168cdb2d27b35356a8105dea784d7e7fb3778ff7b7854162f5de963f2b183034ab955f5d3673613622041434
2022-08-14 01:14:53 +08:00

19 lines
No EOL
853 B
Text

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.shouldUseRule = exports.shouldUseGroup = exports.schemaHasRulesForType = void 0;
function schemaHasRulesForType({ schema, self }, type) {
const group = self.RULES.types[type];
return group && group !== true && shouldUseGroup(schema, group);
}
exports.schemaHasRulesForType = schemaHasRulesForType;
function shouldUseGroup(schema, group) {
return group.rules.some((rule) => shouldUseRule(schema, rule));
}
exports.shouldUseGroup = shouldUseGroup;
function shouldUseRule(schema, rule) {
var _a;
return (schema[rule.keyword] !== undefined ||
((_a = rule.definition.implements) === null || _a === void 0 ? void 0 : _a.some((kwd) => schema[kwd] !== undefined)));
}
exports.shouldUseRule = shouldUseRule;
//# sourceMappingURL=applicability.js.map