Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
render() {
const { children, text, mask } = this.props;
const input = text || children;
return mask ? conformToMask(input, mask).conformedValue : input;
}
}
_conformToMask(value, mask) {
var conformed = conformToMask(value, mask, {
guide: false
});
return conformed.conformedValue;
}
export function handler(field) {
const { mask, value, maskPlaceholder } = field;
const result = conformToMask(value, mask, { placeholderChar: maskPlaceholder });
if ( result.conformedValue.indexOf(maskPlaceholder) > -1 ) {
return carbonFieldsL10n.field.wrongMask;
}
return null;
}