website-auditfy
Version:
> Tool for validate your project on SEO, HTML, CSS, JS, TS, Performance, Security and A11Y
24 lines • 1.06 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.StructuredDataPresentRule = void 0;
const message_model_1 = require("../../../models/message.model");
const message_enum_1 = require("../../../enum/message.enum");
class StructuredDataPresentRule {
constructor(dom, lightHouse) {
this.id = 'structured-data-present';
this.tags = ['html', 'seo'];
this.description = 'Structured data is present';
this.ruleUrl = 'https://developer.chrome.com/docs/lighthouse/seo/structured-data/';
this.dom = dom;
this.lightHouse = lightHouse;
}
check() {
const structuredData = this.dom('script[type="application/ld+json"]');
const present = structuredData.length;
return [
message_model_1.Message.create(`${present} structured data block(s) found`, present > 0 ? message_enum_1.MessageType.passed : this.ruleFlow)
];
}
}
exports.StructuredDataPresentRule = StructuredDataPresentRule;
//# sourceMappingURL=structured-data-present.rule.js.map