mirror of
https://github.com/bpatrik/pigallery2.git
synced 2025-04-07 07:09:59 +02:00
18 lines
479 B
TypeScript
18 lines
479 B
TypeScript
import { Pipe, PipeTransform } from '@angular/core';
|
|
import { FileDTO } from '../../../common/entities/FileDTO';
|
|
import { Utils } from '../../../common/Utils';
|
|
|
|
@Pipe({ name: 'toRelativePath' })
|
|
export class FileDTOToRelativePathPipe implements PipeTransform {
|
|
transform(metaFile: FileDTO): string | null {
|
|
if (!metaFile) {
|
|
return null;
|
|
}
|
|
return Utils.concatUrls(
|
|
metaFile.directory.path,
|
|
metaFile.directory.name,
|
|
metaFile.name
|
|
);
|
|
}
|
|
}
|