All files / app/pipes format-countries.pipe.ts

64.28% Statements 9/14
100% Branches 0/0
0% Functions 0/1
64.28% Lines 9/14

Press n or j to go to the next uncovered block, b, p or k for the previous block.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 151x 1x 1x 1x 1x 1x 1x 1x           1x  
import { Pipe, PipeTransform } from '@angular/core';
 
@Pipe({
	name: 'formatCountries',
	standalone: true,
})
export class FormatCountriesPipe implements PipeTransform {
	transform(countries: any): string {
		if (Array.isArray(countries)) {
			return countries.map((country) => country.name).join(', ') || '';
		}
		return ''; // Return empty string if 'countries' is not an array
	}
}