mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-07 01:54:15 +00:00
19 lines
467 B
TypeScript
19 lines
467 B
TypeScript
import { PipeTransform, Pipe } from '@angular/core';
|
|
|
|
@Pipe({name: 'dsObjectValues'})
|
|
/**
|
|
* Pipe for parsing all values of an object to an array of values
|
|
*/
|
|
export class ObjectValuesPipe implements PipeTransform {
|
|
|
|
/**
|
|
* @param value An object
|
|
* @returns {any} Array with all values of the input object
|
|
*/
|
|
transform(value, args: string[]): any {
|
|
const values = [];
|
|
Object.values(value).forEach((v) => values.push(v));
|
|
return values;
|
|
}
|
|
}
|