mirror of
https://github.com/DSpace/dspace-angular.git
synced 2025-10-09 11:03:05 +00:00
intermediate commit for tests
This commit is contained in:
18
src/app/shared/utils/object-values-pipe.ts
Normal file
18
src/app/shared/utils/object-values-pipe.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
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;
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user