nodejs-web-scraper
Version:
A web scraper for NodeJs
21 lines (15 loc) • 510 B
JavaScript
/**
* Used by composite operations(operations that contain other operations)
* @mixin
*/
const CompositeInjectMixin = {
injectScraper: function (ScraperInstance) {//Override the original init function of Operation
this.scraper = ScraperInstance;
ScraperInstance.registerOperation(this);
for (let operation of this.operations) {
operation.injectScraper(ScraperInstance);
}
this.validateOperationArguments();
},
};
module.exports = CompositeInjectMixin;