lion/packages/ui/components/input-iban/src/formatters.js
gerjanvangeest 8bd27555a8 chore: update to lit3 and other dependencies
BREAKING CHANGE: update to latest major versions of lit, autosize, awesome-phonenumber & ibantools

- fix(validation-messages): get correct validation min and max dates in French (#2163)

- feat(ui): update to lit version 3 and update lion prod dependencies, and create an alpha release

---------

Co-authored-by: gerjanvangeest <gerjanvangeest@users.noreply.github.com>
2024-03-27 18:00:34 +01:00

16 lines
410 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 '';
}
// @ts-ignore should not return null
return friendlyFormatIBAN(modelValue);
}