You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Ombi/src/Ombi/ClientApp/src/app/pipes/HumanizePipe.ts

16 lines
400 B

import { Pipe, PipeTransform } from "@angular/core";
@Pipe({
name: "humanize",
})
export class HumanizePipe implements PipeTransform {
public transform(value: string) {
if ((typeof value) !== "string") {
return value;
}
value = value.split(/(?=[A-Z])/).join(" ");
value = value[0].toUpperCase() + value.slice(1);
return value;
}
}