initial release
This commit is contained in:
13
bizmatch/src/app/pipes/array-to-string.pipe.ts
Normal file
13
bizmatch/src/app/pipes/array-to-string.pipe.ts
Normal file
@@ -0,0 +1,13 @@
|
||||
import { Pipe, PipeTransform } from '@angular/core';
|
||||
|
||||
@Pipe({
|
||||
name: 'arrayToString',
|
||||
standalone: true
|
||||
})
|
||||
export class ArrayToStringPipe implements PipeTransform {
|
||||
|
||||
transform(value: string|string[], separator: string = '\n'): string {
|
||||
return Array.isArray(value)?value.join(separator):value;
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user