项目原始demo,不改动
選択できるのは25トピックまでです。 トピックは、先頭が英数字で、英数字とダッシュ('-')を使用した35文字以内のものにしてください。
このリポジトリはアーカイブされています。 ファイルの閲覧とクローンは可能ですが、プッシュや、課題・プルリクエストのオープンはできません。
 
 
 
 

30 行
509 B

  1. 'use strict';
  2. exports.type = 'perItem';
  3. exports.active = true;
  4. exports.description = 'removes empty attributes';
  5. /**
  6. * Remove attributes with empty values.
  7. *
  8. * @param {Object} item current iteration item
  9. * @return {Boolean} if false, item will be filtered out
  10. *
  11. * @author Kir Belevich
  12. */
  13. exports.fn = function(item) {
  14. if (item.elem) {
  15. item.eachAttr(function(attr) {
  16. if (attr.value === '') {
  17. item.removeAttr(attr.name);
  18. }
  19. });
  20. }
  21. };