UNPKG

@slash-tmp/rgaa-scraper

Version:

Scrapes RGAA's website and fetch topics, criteria and tests into a JSON format.

23 lines 955 B
import RgaaCriterionWrapper from './RgaaCriterionWrapper'; import RgaaTopicWrapper from './RgaaTopicWrapper'; import { RgaaRootWrapper } from './RgaaRootWrapper'; export default class RgaaTestWrapper extends RgaaRootWrapper { constructor(data, root) { super(root); this.id = data.id; this.title = data.title; } get criterion() { const criterionId = this.id.split('.').slice(0, 2).join('.'); return new RgaaCriterionWrapper( // eslint-disable-next-line @typescript-eslint/no-non-null-assertion this._root.criteria.find(criterion => criterion.id === criterionId), this._root); } get topic() { const topicId = this.id.split('.')[0]; return new RgaaTopicWrapper( // eslint-disable-next-line @typescript-eslint/no-non-null-assertion this._root.topics.find(topic => topic.id === topicId), this._root); } } //# sourceMappingURL=RgaaTestWrapper.js.map