multi.js 399 B

1234567891011121314151617181920
  1. 'use strict'
  2. const helper = require('../helper')
  3. class MultiReporter {
  4. constructor (reporters) {
  5. this._reporters = reporters
  6. }
  7. addAdapter (adapter) {
  8. this._reporters.forEach((reporter) => reporter.adapters.push(adapter))
  9. }
  10. removeAdapter (adapter) {
  11. this._reporters.forEach((reporter) => helper.arrayRemove(reporter.adapters, adapter))
  12. }
  13. }
  14. module.exports = MultiReporter