1 import { Pipe, PipeTransform } from '@angular/core';
4 name: 'cephShortVersion'
6 export class CephShortVersionPipe implements PipeTransform {
7 transform(value: any): any {
8 // Expect "ceph version 1.2.3-g9asdasd (as98d7a0s8d7)"
9 const result = /ceph version\s+([^ ]+)\s+\(.+\)/.exec(value);
11 // Return the "1.2.3-g9asdasd" part
14 // Unexpected format, pass it through