Skip to content

Commit ffa4097

Browse files
author
Hector Arce De Las Heras
committed
Improve number maskType utility
Only allows digits now and no other special characters.
1 parent 9def299 commit ffa4097

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/utils/maskUtility/mask.utility.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,9 @@ import { MASK_TYPE } from '@/components/input/types/input';
33
export const cleanInputValueAlphanumeric = (value: string): string => value.replace(/[\W_]+/g, '');
44
export const cleanInputValueAlphanumericWithSpaces = (value: string): string =>
55
value.replace(/[^\w\s]+/g, '');
6-
export const cleanInputValueNumber = (value: string): string => value.replace(/[^\d]|e|"|\^/gi, '');
6+
export const cleanInputValueNumber = (value: string): string => value.replace(/[^\d]/g, '');
77
export const cleanInputValueNumberWithSpaces = (value: string): string =>
8-
value.replace(/[^\d\s]|e|"|\^/gi, '');
8+
value.replace(/[^\d\s]/g, '');
99
export const cleanInputValueLetters = (value: string): string => value.replace(/[^a-zñA-ZÑ]/g, '');
1010
export const cleanInputValueLettersHyphenSpace = (value: string): string =>
1111
value.replace(/[^a-zñA-ZÑ\s-]/g, '');

0 commit comments

Comments
 (0)