Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
'9': /[0-9]/,
U: /[A-Z]/,
A: /[a-zA-Z]/,
'*': /[0-9a-zA-Z]/
};
let { type, ...inputMask } = utils.toCamelCase(this.attrs.mask);
if (type === 'NumberMask') {
if (inputMask.includeThousandsSeparator) {
const regex = new RegExp(inputMask.thousandsSeparatorSymbol, 'g');
this._unmask = value => (typeof value == 'string' ? value.replace(regex, '') : value);
}
inputMask = createNumberMask(inputMask);
}
else inputMask = inputMask.mask.split('').map(c => (maskMap.hasOwnProperty(c) ? maskMap[c] : c));
this._textMask = createTextMaskInputElement({ inputElement: this._inputElement, mask: inputMask });
this._textMask.update(this.value || '');
}
}
initTextMask() {
const { props, props: { value } } = this;
if (props.mask && this.inputControlRef) {
this.textMaskInputElement = createTextMaskInputElement({
inputElement: this.inputControlRef,
...props,
});
this.textMaskInputElement.update(value);
}
}