15 lines
371 B
JavaScript
15 lines
371 B
JavaScript
import { friendlyFormatIBAN } from 'ibantools';
|
|
|
|
/**
|
|
* Takes an unformatted IBAN and returns a formatted one.
|
|
*
|
|
* @param {string} modelValue value to be formatted
|
|
* @return {string} formatted value
|
|
*/
|
|
export function formatIBAN(modelValue) {
|
|
// defensive code because of ibantools
|
|
if (!modelValue) {
|
|
return '';
|
|
}
|
|
return friendlyFormatIBAN(modelValue);
|
|
}
|