removeXMLProcInst.js 487 B

123456789101112131415161718192021222324
  1. 'use strict';
  2. exports.type = 'perItem';
  3. exports.active = true;
  4. exports.description = 'removes XML processing instructions';
  5. /**
  6. * Remove XML Processing Instruction.
  7. *
  8. * @example
  9. * <?xml version="1.0" encoding="utf-8"?>
  10. *
  11. * @param {Object} item current iteration item
  12. * @return {Boolean} if false, item will be filtered out
  13. *
  14. * @author Kir Belevich
  15. */
  16. exports.fn = function(item) {
  17. return !(item.processinginstruction && item.processinginstruction.name === 'xml');
  18. };