@slash-tmp/rgaa-scraper
Version:
Scrapes RGAA's website and fetch topics, criteria and tests into a JSON format.
26 lines • 944 B
JavaScript
import { RgaaRootWrapper } from './RgaaRootWrapper';
import RgaaTopicWrapper from './RgaaTopicWrapper';
import RgaaCriterionWrapper from './RgaaCriterionWrapper';
import RgaaTestWrapper from './RgaaTestWrapper';
import { filterElements } from './utils';
export default class RgaaResultWrapper extends RgaaRootWrapper {
constructor(root) {
super(root);
}
topics(filter) {
return this._root.topics
.filter(filterElements(filter))
.map(topic => new RgaaTopicWrapper(topic, this._root));
}
criteria(filter) {
return this._root.criteria
.filter(filterElements(filter))
.map(criterion => new RgaaCriterionWrapper(criterion, this._root));
}
tests(filter) {
return this._root.tests
.filter(filterElements(filter))
.map(test => new RgaaTestWrapper(test, this._root));
}
}
//# sourceMappingURL=RgaaResultWrapper.js.map