diff --git a/ChangeLog b/ChangeLog index 65b4efe..1f7769b 100755 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,6 @@ +2026-06-26 btrdnch + * Added SEPA: true and account_indentifier for RS (Serbia) + 2026-04-10 Saša Jovanić * Version 4.5.4 diff --git a/dist/ibantools.js b/dist/ibantools.js index 83f1d7f..8a38b00 100644 --- a/dist/ibantools.js +++ b/dist/ibantools.js @@ -1532,7 +1532,9 @@ define(["require", "exports"], function (require, exports) { bban_regexp: '^[0-9]{18}$', bban_validation_func: checkMod9710BBAN, IBANRegistry: true, + SEPA: true, bank_identifier: '0-2', + account_indentifier: '3-15', }, RU: { chars: 33, diff --git a/docs/enums/ValidationErrorsBIC.html b/docs/enums/ValidationErrorsBIC.html index 7e0c095..ec6e135 100644 --- a/docs/enums/ValidationErrorsBIC.html +++ b/docs/enums/ValidationErrorsBIC.html @@ -1,5 +1,5 @@ ValidationErrorsBIC | IBANTools
IBANTools
    Preparing search index...

    Enumeration ValidationErrorsBIC

    BIC validation errors

    -
    Index

    Enumeration Members

    Index

    Enumeration Members

    NoBICCountry: 1
    NoBICProvided: 0
    WrongBICFormat: 2
    +

    Enumeration Members

    NoBICCountry: 1
    NoBICProvided: 0
    WrongBICFormat: 2
    diff --git a/docs/enums/ValidationErrorsIBAN.html b/docs/enums/ValidationErrorsIBAN.html index 77c7b2d..78a25ab 100644 --- a/docs/enums/ValidationErrorsIBAN.html +++ b/docs/enums/ValidationErrorsIBAN.html @@ -1,5 +1,5 @@ ValidationErrorsIBAN | IBANTools
    IBANTools
      Preparing search index...

      Enumeration ValidationErrorsIBAN

      IBAM validation errors

      -
      Index

      Enumeration Members

      Index

      Enumeration Members

      ChecksumNotNumber: 4
      NoIBANCountry: 1
      NoIBANProvided: 0
      QRIBANNotAllowed: 7
      WrongAccountBankBranchChecksum: 6
      WrongBBANFormat: 3
      WrongBBANLength: 2
      WrongIBANChecksum: 5
      +

      Enumeration Members

      ChecksumNotNumber: 4
      NoIBANCountry: 1
      NoIBANProvided: 0
      QRIBANNotAllowed: 7
      WrongAccountBankBranchChecksum: 6
      WrongBBANFormat: 3
      WrongBBANLength: 2
      WrongIBANChecksum: 5
      diff --git a/docs/functions/composeIBAN.html b/docs/functions/composeIBAN.html index 709e4ff..b187c2d 100644 --- a/docs/functions/composeIBAN.html +++ b/docs/functions/composeIBAN.html @@ -2,4 +2,4 @@
      // returns NL91ABNA0417164300
      ibantools.composeIBAN({ countryCode: "NL", bban: "ABNA0417164300" });
      -

      Parameters

      Returns string | null

      +

      Parameters

      Returns string | null

      diff --git a/docs/functions/electronicFormatIBAN.html b/docs/functions/electronicFormatIBAN.html index 0f556a4..1e34d22 100644 --- a/docs/functions/electronicFormatIBAN.html +++ b/docs/functions/electronicFormatIBAN.html @@ -4,4 +4,4 @@
      // returns "NL91ABNA0417164300"
      ibantools.electronicFormatIBAN("NL91 ABNA 0417 1643 00");
      -

      Parameters

      • Optionaliban: string

      Returns string | null

      +

      Parameters

      • Optionaliban: string

      Returns string | null

      diff --git a/docs/functions/extractBIC.html b/docs/functions/extractBIC.html index 0f29412..01dc510 100644 --- a/docs/functions/extractBIC.html +++ b/docs/functions/extractBIC.html @@ -2,4 +2,4 @@
      // returns {bankCode: "ABNA", countryCode: "NL", locationCode: "2A", branchCode: null, testBIC: false, valid: true}
      ibantools.extractBIC("ABNANL2A");
      -

      Parameters

      • inputBic: string

      Returns ExtractBICResult

      +

      Parameters

      • inputBic: string

      Returns ExtractBICResult

      diff --git a/docs/functions/extractIBAN.html b/docs/functions/extractIBAN.html index 48a9d83..6d69e6f 100644 --- a/docs/functions/extractIBAN.html +++ b/docs/functions/extractIBAN.html @@ -2,4 +2,4 @@
      // returns {iban: "NL91ABNA0417164300", bban: "ABNA0417164300", countryCode: "NL", valid: true, accountNumber: '0417164300', bankIdentifier: 'ABNA'}
      ibantools.extractIBAN("NL91 ABNA 0417 1643 00");
      -

      Parameters

      • iban: string

      Returns ExtractIBANResult

      +

      Parameters

      • iban: string

      Returns ExtractIBANResult

      diff --git a/docs/functions/friendlyFormatIBAN.html b/docs/functions/friendlyFormatIBAN.html index c0c082d..54dfb52 100644 --- a/docs/functions/friendlyFormatIBAN.html +++ b/docs/functions/friendlyFormatIBAN.html @@ -7,4 +7,4 @@
      // returns "NL91-ABNA-0417-1643-00"
      ibantools.friendlyFormatIBAN("NL91ABNA0417164300","-");
      -

      Parameters

      • Optionaliban: string
      • Optionalseparator: string

      Returns string | null

      +

      Parameters

      • Optionaliban: string
      • Optionalseparator: string

      Returns string | null

      diff --git a/docs/functions/getCountrySpecifications.html b/docs/functions/getCountrySpecifications.html index a10aa9d..3555487 100644 --- a/docs/functions/getCountrySpecifications.html +++ b/docs/functions/getCountrySpecifications.html @@ -4,4 +4,4 @@
      // Validating IBAN form field after user selects his country
      // <select id="countries">
      // ...
      // <option value="NL">Netherlands</option>
      // ...
      // </select>
      $("#countries").select(function() {
      // Find country
      let country = ibantools.getCountrySpecifications()[$(this).val()];
      // Add country code letters to IBAN form field
      $("input#iban").value($(this).val());
      // Add New value to "pattern" attribute to #iban input text field
      $("input#iban").attr("pattern", $(this).val() + "[0-9]{2}" + country.bban_regexp.slice(1).replace("$",""));
      });
      -

      Returns CountryMap

      +

      Returns CountryMap

      diff --git a/docs/functions/isQRIBAN.html b/docs/functions/isQRIBAN.html index 50aefa2..d83b8b0 100644 --- a/docs/functions/isQRIBAN.html +++ b/docs/functions/isQRIBAN.html @@ -5,4 +5,4 @@
      // returns false
      ibantools.isQRIBAN("NL92ABNA0517164300");
      -

      Parameters

      • iban: string

      Returns boolean

      +

      Parameters

      • iban: string

      Returns boolean

      diff --git a/docs/functions/isSEPACountry.html b/docs/functions/isSEPACountry.html index 2aa77ab..d9b909a 100644 --- a/docs/functions/isSEPACountry.html +++ b/docs/functions/isSEPACountry.html @@ -5,4 +5,4 @@
      // returns false
      ibantools.isSEPACountry("PK");
      -

      Parameters

      • countryCode: string

      Returns boolean

      +

      Parameters

      • countryCode: string

      Returns boolean

      diff --git a/docs/functions/isValidBBAN.html b/docs/functions/isValidBBAN.html index d7ae9b9..30d5f91 100644 --- a/docs/functions/isValidBBAN.html +++ b/docs/functions/isValidBBAN.html @@ -5,4 +5,4 @@
      // returns false
      ibantools.isValidBBAN("A7NA0517164300", "NL");
      -

      Parameters

      • Optionalbban: string
      • OptionalcountryCode: string

      Returns boolean

      +

      Parameters

      • Optionalbban: string
      • OptionalcountryCode: string

      Returns boolean

      diff --git a/docs/functions/isValidBIC.html b/docs/functions/isValidBIC.html index 853156a..2ec80a4 100644 --- a/docs/functions/isValidBIC.html +++ b/docs/functions/isValidBIC.html @@ -2,4 +2,4 @@
      // returns true
      ibantools.isValidBIC("ABNANL2A");

      // returns true
      ibantools.isValidBIC("NEDSZAJJXXX");

      // returns false
      ibantools.isValidBIC("ABN4NL2A");

      // returns false
      ibantools.isValidBIC("ABNA NL 2A");
      -

      Parameters

      • bic: string

      Returns boolean

      +

      Parameters

      • bic: string

      Returns boolean

      diff --git a/docs/functions/isValidIBAN.html b/docs/functions/isValidIBAN.html index f7d132d..6bdcc49 100644 --- a/docs/functions/isValidIBAN.html +++ b/docs/functions/isValidIBAN.html @@ -11,4 +11,4 @@
      // returns false
      ibantools.isValidIBAN('CH4431999123000889012', { allowQRIBAN: false });
      -

      Parameters

      Returns boolean

      +

      Parameters

      Returns boolean

      diff --git a/docs/functions/setCountryBBANValidation.html b/docs/functions/setCountryBBANValidation.html index 207b130..a3d54a9 100644 --- a/docs/functions/setCountryBBANValidation.html +++ b/docs/functions/setCountryBBANValidation.html @@ -1,4 +1,4 @@ setCountryBBANValidation | IBANTools
      IBANTools
        Preparing search index...

        Function setCountryBBANValidation

        • Set custom BBAN validation function for country.

          If bban_validation_func already exists for the corresponding country, it will be overwritten.

          -

          Parameters

          • country: string
          • func: (bban: string) => boolean

          Returns boolean

        +

        Parameters

        • country: string
        • func: (bban: string) => boolean

        Returns boolean

        diff --git a/docs/functions/validateBIC.html b/docs/functions/validateBIC.html index 8c74f6a..1bcf548 100644 --- a/docs/functions/validateBIC.html +++ b/docs/functions/validateBIC.html @@ -2,4 +2,4 @@
        // returns {errorCodes: [], valid: true}
        ibantools.validateBIC("NEDSZAJJXXX");
        -

        Parameters

        • Optionalbic: string

        Returns ValidateBICResult

        +

        Parameters

        • Optionalbic: string

        Returns ValidateBICResult

        diff --git a/docs/functions/validateIBAN.html b/docs/functions/validateIBAN.html index 7fe5aa9..38482fc 100644 --- a/docs/functions/validateIBAN.html +++ b/docs/functions/validateIBAN.html @@ -15,4 +15,4 @@
        
         
        -

        Parameters

        Returns ValidateIBANResult

        +

        Parameters

        Returns ValidateIBANResult

        diff --git a/docs/interfaces/ComposeIBANParams.html b/docs/interfaces/ComposeIBANParams.html index e7d17f6..76597bd 100644 --- a/docs/interfaces/ComposeIBANParams.html +++ b/docs/interfaces/ComposeIBANParams.html @@ -1,4 +1,4 @@ ComposeIBANParams | IBANTools
        IBANTools
          Preparing search index...

          Interface ComposeIBANParams

          Interface for ComposeIBAN parameteres

          -
          interface ComposeIBANParams {
              bban?: string;
              countryCode?: string;
          }
          Index

          Properties

          interface ComposeIBANParams {
              bban?: string;
              countryCode?: string;
          }
          Index

          Properties

          Properties

          bban?: string
          countryCode?: string
          +

          Properties

          bban?: string
          countryCode?: string
          diff --git a/docs/interfaces/CountryMap.html b/docs/interfaces/CountryMap.html index 053dcec..9f143f1 100644 --- a/docs/interfaces/CountryMap.html +++ b/docs/interfaces/CountryMap.html @@ -1,2 +1,2 @@ CountryMap | IBANTools
          IBANTools
            Preparing search index...

            Interface CountryMap

            Interface for Map of Country Specifications

            -

            Indexable

            +

            Indexable

            diff --git a/docs/interfaces/CountrySpec.html b/docs/interfaces/CountrySpec.html index 21c43f1..fc63d6e 100644 --- a/docs/interfaces/CountrySpec.html +++ b/docs/interfaces/CountrySpec.html @@ -1,6 +1,6 @@ CountrySpec | IBANTools
            IBANTools
              Preparing search index...

              Interface CountrySpec

              Interface for IBAN Country Specification

              -
              interface CountrySpec {
                  bban_regexp: string | null;
                  chars: number | null;
                  IBANRegistry: boolean;
                  SEPA: boolean;
              }
              Index

              Properties

              interface CountrySpec {
                  bban_regexp: string | null;
                  chars: number | null;
                  IBANRegistry: boolean;
                  SEPA: boolean;
              }
              Index

              Properties

              bban_regexp: string | null
              chars: number | null
              IBANRegistry: boolean
              SEPA: boolean
              +

              Properties

              bban_regexp: string | null
              chars: number | null
              IBANRegistry: boolean
              SEPA: boolean
              diff --git a/docs/interfaces/ExtractBICResult.html b/docs/interfaces/ExtractBICResult.html index d8db25d..652c1b2 100644 --- a/docs/interfaces/ExtractBICResult.html +++ b/docs/interfaces/ExtractBICResult.html @@ -1,8 +1,8 @@ ExtractBICResult | IBANTools
              IBANTools
                Preparing search index...

                Interface ExtractBICResult

                Interface for ExtractBIC result

                -
                interface ExtractBICResult {
                    bankCode?: string;
                    branchCode: string | null;
                    countryCode?: string;
                    locationCode?: string;
                    testBIC: boolean;
                    valid: boolean;
                }
                Index

                Properties

                interface ExtractBICResult {
                    bankCode?: string;
                    branchCode: string | null;
                    countryCode?: string;
                    locationCode?: string;
                    testBIC: boolean;
                    valid: boolean;
                }
                Index

                Properties

                bankCode?: string
                branchCode: string | null
                countryCode?: string
                locationCode?: string
                testBIC: boolean
                valid: boolean
                +

                Properties

                bankCode?: string
                branchCode: string | null
                countryCode?: string
                locationCode?: string
                testBIC: boolean
                valid: boolean
                diff --git a/docs/interfaces/ExtractIBANResult.html b/docs/interfaces/ExtractIBANResult.html index 2dfa441..6116842 100644 --- a/docs/interfaces/ExtractIBANResult.html +++ b/docs/interfaces/ExtractIBANResult.html @@ -1,9 +1,9 @@ ExtractIBANResult | IBANTools
                IBANTools
                  Preparing search index...

                  Interface ExtractIBANResult

                  Interface for ExtractIBAN result

                  -
                  interface ExtractIBANResult {
                      accountNumber?: string;
                      bankIdentifier?: string;
                      bban?: string;
                      branchIdentifier?: string;
                      countryCode?: string;
                      iban: string;
                      valid: boolean;
                  }
                  Index

                  Properties

                  interface ExtractIBANResult {
                      accountNumber?: string;
                      bankIdentifier?: string;
                      bban?: string;
                      branchIdentifier?: string;
                      countryCode?: string;
                      iban: string;
                      valid: boolean;
                  }
                  Index

                  Properties

                  accountNumber?: string
                  bankIdentifier?: string
                  bban?: string
                  branchIdentifier?: string
                  countryCode?: string
                  iban: string
                  valid: boolean
                  +

                  Properties

                  accountNumber?: string
                  bankIdentifier?: string
                  bban?: string
                  branchIdentifier?: string
                  countryCode?: string
                  iban: string
                  valid: boolean
                  diff --git a/docs/interfaces/ValidateBICResult.html b/docs/interfaces/ValidateBICResult.html index 53d132b..d54ab95 100644 --- a/docs/interfaces/ValidateBICResult.html +++ b/docs/interfaces/ValidateBICResult.html @@ -1,4 +1,4 @@ ValidateBICResult | IBANTools
                  IBANTools
                    Preparing search index...

                    Interface ValidateBICResult

                    Interface for ValidateBIC result

                    -
                    interface ValidateBICResult {
                        errorCodes: ValidationErrorsBIC[];
                        valid: boolean;
                    }
                    Index

                    Properties

                    interface ValidateBICResult {
                        errorCodes: ValidationErrorsBIC[];
                        valid: boolean;
                    }
                    Index

                    Properties

                    Properties

                    errorCodes: ValidationErrorsBIC[]
                    valid: boolean
                    +

                    Properties

                    errorCodes: ValidationErrorsBIC[]
                    valid: boolean
                    diff --git a/docs/interfaces/ValidateIBANOptions.html b/docs/interfaces/ValidateIBANOptions.html index 970b6d7..209679a 100644 --- a/docs/interfaces/ValidateIBANOptions.html +++ b/docs/interfaces/ValidateIBANOptions.html @@ -1,3 +1,3 @@ ValidateIBANOptions | IBANTools
                    IBANTools
                      Preparing search index...

                      Interface ValidateIBANOptions

                      Interface for validation options

                      -
                      interface ValidateIBANOptions {
                          allowQRIBAN: boolean;
                      }
                      Index

                      Properties

                      Properties

                      allowQRIBAN: boolean
                      +
                      interface ValidateIBANOptions {
                          allowQRIBAN: boolean;
                      }
                      Index

                      Properties

                      Properties

                      allowQRIBAN: boolean
                      diff --git a/docs/interfaces/ValidateIBANResult.html b/docs/interfaces/ValidateIBANResult.html index 9288571..e20bb82 100644 --- a/docs/interfaces/ValidateIBANResult.html +++ b/docs/interfaces/ValidateIBANResult.html @@ -1,4 +1,4 @@ ValidateIBANResult | IBANTools
                      IBANTools
                        Preparing search index...

                        Interface ValidateIBANResult

                        Interface for ValidateIBAN result

                        -
                        interface ValidateIBANResult {
                            errorCodes: ValidationErrorsIBAN[];
                            valid: boolean;
                        }
                        Index

                        Properties

                        interface ValidateIBANResult {
                            errorCodes: ValidationErrorsIBAN[];
                            valid: boolean;
                        }
                        Index

                        Properties

                        Properties

                        errorCodes: ValidationErrorsIBAN[]
                        valid: boolean
                        +

                        Properties

                        errorCodes: ValidationErrorsIBAN[]
                        valid: boolean
                        diff --git a/docs/variables/countrySpecs.html b/docs/variables/countrySpecs.html index ef4dc64..1dfa7d9 100644 --- a/docs/variables/countrySpecs.html +++ b/docs/variables/countrySpecs.html @@ -1,2 +1,2 @@ countrySpecs | IBANTools
                        IBANTools
                          Preparing search index...

                          Variable countrySpecsConst

                          countrySpecs: CountryMapInternal = ...

                          Country specifications

                          -
                          +
                          diff --git a/src/ibantools.ts b/src/ibantools.ts index f565bdd..2b6f49e 100755 --- a/src/ibantools.ts +++ b/src/ibantools.ts @@ -1652,7 +1652,9 @@ export const countrySpecs: CountryMapInternal = { bban_regexp: '^[0-9]{18}$', bban_validation_func: checkMod9710BBAN, IBANRegistry: true, + SEPA: true, bank_identifier: '0-2', + account_indentifier: '3-15', }, RU: { chars: 33, diff --git a/test/ibantools_test.js b/test/ibantools_test.js index 037a995..6391394 100644 --- a/test/ibantools_test.js +++ b/test/ibantools_test.js @@ -552,6 +552,9 @@ describe('IBANTools', function() { it('with non valid country code XX return false', function() { return expect(iban.isSEPACountry('XX')).to.be.false; }); + it('with valid country code RS should return true', function() { + return expect(iban.isSEPACountry('RS')).to.be.true; + }); }); describe('When calling extractBIC() with valid BIC ABNANL2A', function() {