mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 10:04:11 +00:00

- Introduced pipes for combined null/undefined checks: dsHasValue & dsHasNoValue - Safer to async !== true than async === false - Went over other instances of async === to confirm that they should be fine
17 lines
328 B
TypeScript
17 lines
328 B
TypeScript
import {
|
|
Pipe,
|
|
PipeTransform,
|
|
} from '@angular/core';
|
|
|
|
import { hasNoValue } from '../empty.util';
|
|
|
|
/**
|
|
* Returns true if the passed value is null or undefined.
|
|
*/
|
|
@Pipe({ name: 'dsHasNoValue' })
|
|
export class HasNoValuePipe implements PipeTransform {
|
|
transform(value: any): boolean {
|
|
return hasNoValue(value);
|
|
}
|
|
}
|