Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getConfig(config: ITextMaskConfigOptions, addon?: { name, config }): ITextMaskConfigOptions {
const safeConfig: ITextMaskConfigOptions = this.getBasicConfig(config);
const addonName = (addon && 'name' in addon) ? addon.name : '';
switch (addonName) {
case 'createNumberMask':
const numberMask = createNumberMask(addon.config);
safeConfig.mask = numberMask;
break;
case 'emailMask':
safeConfig.mask = emailMask;
break;
case 'createAutoCorrectedDatePipe':
safeConfig.pipe = createAutoCorrectedDatePipe('mm/dd/yyyy');
safeConfig.keepCharPositions = true;
break;
}
return safeConfig;
}