import { i18n } from '@plugins/i18n';

export function okatoFormatRule(val: string): boolean | string {
  const pattern = /^(?!(?:8|11)$)[0-9]*$/;
  return val
    ? !pattern.test(String(val.length)) ||
        String(i18n.t('validation.regions.invalidOkatoFormat'))
    : !val;
}
