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 15 16 17 18 19 20 21 22 23 | 77x 77x 2x 1x | import { Pipe, PipeTransform } from '@angular/core';
import { ProxyService } from '../service/api/proxy.service';
@Pipe({
name: 'cssUrl',
pure: true
})
export class CssUrlPipe implements PipeTransform {
constructor(
private proxy: ProxyService,
) { }
transform(url: string | null, skip = ''): string | null {
Eif (!url) return '';
url = url.trim();
skip = skip.trim();
if (!url || url === skip || this.proxy.isProxied(url) === skip) return '';
return `url("${url}")`;
}
}
|