diff options
Diffstat (limited to 'catalog-ui/src/app/filters/clear-whitespaces-filter.ts')
-rw-r--r-- | catalog-ui/src/app/filters/clear-whitespaces-filter.ts | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/catalog-ui/src/app/filters/clear-whitespaces-filter.ts b/catalog-ui/src/app/filters/clear-whitespaces-filter.ts new file mode 100644 index 0000000000..ea6129e22b --- /dev/null +++ b/catalog-ui/src/app/filters/clear-whitespaces-filter.ts @@ -0,0 +1,16 @@ +export class ClearWhiteSpacesFilter { + + constructor() { + let filter = <ClearWhiteSpacesFilter>( (text:string) => { + if (!angular.isString(text)) { + return text; + } + + return text.replace(/ /g, ''); // remove also whitespaces inside + }); + + return filter; + } +} + + |