]> git.proxmox.com Git - ceph.git/blob - ceph/src/pybind/mgr/dashboard/frontend/src/app/shared/pipes/empty.pipe.ts
import ceph quincy 17.2.1
[ceph.git] / ceph / src / pybind / mgr / dashboard / frontend / src / app / shared / pipes / empty.pipe.ts
1 import { Pipe, PipeTransform } from '@angular/core';
2
3 import _ from 'lodash';
4
5 @Pipe({
6 name: 'empty'
7 })
8 export class EmptyPipe implements PipeTransform {
9 transform(value: any): any {
10 if (_.isUndefined(value) || _.isNull(value)) {
11 return '-';
12 } else if (_.isNaN(value)) {
13 return 'N/A';
14 }
15 return value;
16 }
17 }