Co-authored-by: Mikhail Bashkirov <mikhail.bashkirov@ing.com> Co-authored-by: Thijs Louisse <thijs.louisse@ing.com> Co-authored-by: Joren Broekema <joren.broekema@ing.com> Co-authored-by: Gerjan van Geest <gerjan.van.geest@ing.com> Co-authored-by: Erik Kroes <erik.kroes@ing.com> Co-authored-by: Lars den Bakker <lars.den.bakker@ing.com>
12 lines
381 B
JavaScript
12 lines
381 B
JavaScript
import { isValidIBAN } from '@bundled-es-modules/ibantools';
|
|
|
|
/**
|
|
* Parses an IBAN trimming spaces and making uppercase.
|
|
*
|
|
* @param {string} viewValue value to be parsed
|
|
* @return {string} parsed value
|
|
*/
|
|
export function parseIBAN(viewValue) {
|
|
const trimmedValue = viewValue.replace(/\s/g, '').toUpperCase();
|
|
return isValidIBAN(trimmedValue) ? trimmedValue : undefined;
|
|
}
|