1.0.4 • Published 6 years ago
@feizheng/next-filter-nil v1.0.4
next-filter-nil
Filter null/undefined value.
installation
npm install -S @feizheng/next-filter-nilusage
import '@feizheng/next-filter-nil';
nx.filterNil({
  left: null,
  right: 0,
  title: {
    text: '堆叠区域图'
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'cross',
      label: {
        left: null,
        right: 10,
        backgroundColor: '#6a7985'
      }
    }
  },
  legend: {
    data: ['邮件营销', '联盟广告', '视频广告', '直接访问', '搜索引擎']
  },
  toolbox: {
    feature: {
      saveAsImage: {
        target: null
      }
    }
  }
},null);
// ================= result  ================= 
{
  right: 0,
  title: {
    text: '堆叠区域图'
  },
  tooltip: {
    trigger: 'axis',
    axisPointer: {
      type: 'cross',
      label: {
        right: 10,
        backgroundColor: '#6a7985'
      }
    }
  },
  legend: {
    data: ['邮件营销', '联盟广告', '视频广告', '直接访问', '搜索引擎']
  },
  toolbox: {
    feature: {
      saveAsImage: { }
    }
  }
}