aboutsummaryrefslogtreecommitdiffstats
path: root/vid-webpack-master/src/app/shared/pipes/spaceToUnderscore/space-to-underscore.pipe.ts
blob: b82b28bc1104ed96bbf9771b9b3d1f4dfb5b2b76 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
import { Pipe, PipeTransform } from '@angular/core';

@Pipe({
  name: 'spaceToUnderscore'
})
export class SpaceToUnderscorePipe implements PipeTransform {

  transform(text: string): string {
    if (text) {
      // @ts-ignore
      text = text.replaceAll(' ', '_');
      return text;
    }
    return text;
  }

}