mirror of
https://github.com/Start9Labs/start-os.git
synced 2026-03-30 20:14:49 +00:00
12 lines
311 B
TypeScript
12 lines
311 B
TypeScript
import { Pipe, PipeTransform } from '@angular/core'
|
|
import { isEmptyObject } from '../util/misc.util'
|
|
|
|
@Pipe({
|
|
name: 'empty',
|
|
})
|
|
export class EmptyPipe implements PipeTransform {
|
|
transform (val: object | [] = { }): boolean {
|
|
if (Array.isArray(val)) return !val.length
|
|
return isEmptyObject(val)
|
|
}
|
|
} |