ibantools 4.3.5 → 4.3.7

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -8,7 +8,7 @@
8
8
  * @package Documentation
9
9
  * @author Saša Jovanić
10
10
  * @module ibantools
11
- * @version 4.3.5
11
+ * @version 4.3.7
12
12
  * @license MPL-2.0
13
13
  * @preferred
14
14
  */
@@ -776,6 +776,37 @@ var checkHungarianBBAN = function (bban) {
776
776
  return controlDigitAccount === (remainder_2 === 0 ? 0 : 10 - remainder_2);
777
777
  }
778
778
  };
779
+ /**
780
+ * Dutch (NL) BBAN check
781
+ *
782
+ * @ignore
783
+ */
784
+ var checkDutchBBAN = function (bban) {
785
+ if (bban === '') {
786
+ return false;
787
+ }
788
+ var weights = [10, 9, 8, 7, 6, 5, 4, 3, 2, 1];
789
+ var toCheckAccount = bban.substring(4, 14);
790
+ if (toCheckAccount.startsWith('000')) {
791
+ return true;
792
+ }
793
+ if (toCheckAccount.startsWith('00')) {
794
+ return false;
795
+ }
796
+ var sum = toCheckAccount
797
+ .split('')
798
+ .map(function (value, index) {
799
+ if (value === '0' && index === 0) {
800
+ return 0;
801
+ }
802
+ var number = parseInt(value, 10);
803
+ var weight = weights[index];
804
+ return number * weight;
805
+ })
806
+ .reduce(function (a, b) { return a + b; });
807
+ console.log(sum);
808
+ return sum % 11 === 0;
809
+ };
779
810
  /**
780
811
  * Set custom BBAN validation function for country.
781
812
  *
@@ -1429,6 +1460,7 @@ exports.countrySpecs = {
1429
1460
  NL: {
1430
1461
  chars: 18,
1431
1462
  bban_regexp: '^[A-Z]{4}[0-9]{10}$',
1463
+ bban_validation_func: checkDutchBBAN,
1432
1464
  IBANRegistry: true,
1433
1465
  SEPA: true,
1434
1466
  bank_identifier: '0-3',
@@ -1564,8 +1596,9 @@ exports.countrySpecs = {
1564
1596
  bban_validation_func: checkMod9710BBAN,
1565
1597
  IBANRegistry: true,
1566
1598
  SEPA: true,
1567
- bank_identifier: '-1-4',
1568
- account_indentifier: '4-19',
1599
+ branch_indentifier: '2-4',
1600
+ bank_identifier: '0-1',
1601
+ account_indentifier: '9-16',
1569
1602
  },
1570
1603
  SJ: {},
1571
1604
  SK: {
@@ -8,7 +8,7 @@
8
8
  * @package Documentation
9
9
  * @author Saša Jovanić
10
10
  * @module ibantools
11
- * @version 4.3.4
11
+ * @version 4.3.6
12
12
  * @license MPL-2.0
13
13
  * @preferred
14
14
  */
@@ -221,7 +221,7 @@ export function composeIBAN(params) {
221
221
  /**
222
222
  * extractIBAN
223
223
  * ```
224
- * // returns {iban: "NL91ABNA0417164300", bban: "ABNA0417164300", countryCode: "NL", valid: true}
224
+ * // returns {iban: "NL91ABNA0417164300", bban: "ABNA0417164300", countryCode: "NL", valid: true, accountNumber: '0417164300', bankIdentifier: 'ABNA'}
225
225
  * ibantools.extractIBAN("NL91 ABNA 0417 1643 00");
226
226
  * ```
227
227
  */
@@ -233,6 +233,25 @@ export function extractIBAN(iban) {
233
233
  result.bban = eFormatIBAN.slice(4);
234
234
  result.countryCode = eFormatIBAN.slice(0, 2);
235
235
  result.valid = true;
236
+ var spec = countrySpecs[result.countryCode];
237
+ if (spec.account_indentifier) {
238
+ var ac = spec.account_indentifier.split('-');
239
+ var starting = parseInt(ac[0]);
240
+ var ending = parseInt(ac[1]);
241
+ result.accountNumber = result.iban.slice(starting, ending + 1);
242
+ }
243
+ if (spec.bank_identifier) {
244
+ var ac = spec.bank_identifier.split('-');
245
+ var starting = parseInt(ac[0]);
246
+ var ending = parseInt(ac[1]);
247
+ result.bankIdentifier = result.bban.slice(starting, ending + 1);
248
+ }
249
+ if (spec.branch_indentifier) {
250
+ var ac = spec.branch_indentifier.split('-');
251
+ var starting = parseInt(ac[0]);
252
+ var ending = parseInt(ac[1]);
253
+ result.branchIdentifier = result.bban.slice(starting, ending + 1);
254
+ }
236
255
  }
237
256
  else {
238
257
  result.valid = false;
@@ -764,11 +783,16 @@ export var countrySpecs = {
764
783
  bban_regexp: '^[0-9]{8}[A-Z0-9]{12}$',
765
784
  IBANRegistry: true,
766
785
  SEPA: true,
786
+ branch_indentifier: '4-7',
787
+ bank_identifier: '0-3',
788
+ account_indentifier: '8-24',
767
789
  },
768
790
  AE: {
769
791
  chars: 23,
770
792
  bban_regexp: '^[0-9]{3}[0-9]{16}$',
771
793
  IBANRegistry: true,
794
+ bank_identifier: '0-2',
795
+ account_indentifier: '7-23',
772
796
  },
773
797
  AF: {},
774
798
  AG: {},
@@ -777,6 +801,9 @@ export var countrySpecs = {
777
801
  chars: 28,
778
802
  bban_regexp: '^[0-9]{8}[A-Z0-9]{16}$',
779
803
  IBANRegistry: true,
804
+ branch_indentifier: '3-7',
805
+ bank_identifier: '0-2',
806
+ account_indentifier: '12-28',
780
807
  },
781
808
  AM: {},
782
809
  AO: {
@@ -786,7 +813,7 @@ export var countrySpecs = {
786
813
  AQ: {},
787
814
  AR: {},
788
815
  AS: {},
789
- AT: { chars: 20, bban_regexp: '^[0-9]{16}$', IBANRegistry: true, SEPA: true },
816
+ AT: { chars: 20, bban_regexp: '^[0-9]{16}$', IBANRegistry: true, SEPA: true, bank_identifier: '0-4' },
790
817
  AU: {},
791
818
  AW: {},
792
819
  AX: {
@@ -798,16 +825,28 @@ export var countrySpecs = {
798
825
  chars: 28,
799
826
  bban_regexp: '^[A-Z]{4}[A-Z0-9]{20}$',
800
827
  IBANRegistry: true,
828
+ bank_identifier: '0-3',
829
+ account_indentifier: '4-28',
801
830
  },
802
831
  BA: {
803
832
  chars: 20,
804
833
  bban_regexp: '^[0-9]{16}$',
805
834
  bban_validation_func: checkMod9710BBAN,
806
835
  IBANRegistry: true,
836
+ branch_indentifier: '3-5',
837
+ bank_identifier: '0-2',
807
838
  },
808
839
  BB: {},
809
840
  BD: {},
810
- BE: { chars: 16, bban_regexp: '^[0-9]{12}$', bban_validation_func: checkBelgianBBAN, IBANRegistry: true, SEPA: true },
841
+ BE: {
842
+ chars: 16,
843
+ bban_regexp: '^[0-9]{12}$',
844
+ bban_validation_func: checkBelgianBBAN,
845
+ IBANRegistry: true,
846
+ SEPA: true,
847
+ bank_identifier: '0-2',
848
+ account_indentifier: '0-16',
849
+ },
811
850
  BF: {
812
851
  chars: 28,
813
852
  bban_regexp: '^[A-Z0-9]{2}[0-9]{22}$',
@@ -817,15 +856,22 @@ export var countrySpecs = {
817
856
  bban_regexp: '^[A-Z]{4}[0-9]{6}[A-Z0-9]{8}$',
818
857
  IBANRegistry: true,
819
858
  SEPA: true,
859
+ branch_indentifier: '4-7',
860
+ bank_identifier: '0-3',
820
861
  },
821
862
  BH: {
822
863
  chars: 22,
823
864
  bban_regexp: '^[A-Z]{4}[A-Z0-9]{14}$',
824
865
  IBANRegistry: true,
866
+ bank_identifier: '0-3',
867
+ account_indentifier: '8-22',
825
868
  },
826
869
  BI: {
827
870
  chars: 27,
828
871
  bban_regexp: '^[0-9]{23}$',
872
+ branch_indentifier: '5-9',
873
+ bank_identifier: '0-4',
874
+ account_indentifier: '14-27',
829
875
  },
830
876
  BJ: {
831
877
  chars: 28,
@@ -834,7 +880,6 @@ export var countrySpecs = {
834
880
  BL: {
835
881
  chars: 27,
836
882
  bban_regexp: '^[0-9]{10}[A-Z0-9]{11}[0-9]{2}$',
837
- IBANRegistry: true,
838
883
  },
839
884
  BM: {},
840
885
  BN: {},
@@ -844,6 +889,9 @@ export var countrySpecs = {
844
889
  chars: 29,
845
890
  bban_regexp: '^[0-9]{23}[A-Z]{1}[A-Z0-9]{1}$',
846
891
  IBANRegistry: true,
892
+ branch_indentifier: '8-12',
893
+ bank_identifier: '0-7',
894
+ account_indentifier: '17-29',
847
895
  },
848
896
  BS: {},
849
897
  BT: {},
@@ -853,6 +901,7 @@ export var countrySpecs = {
853
901
  chars: 28,
854
902
  bban_regexp: '^[A-Z]{4}[0-9]{4}[A-Z0-9]{16}$',
855
903
  IBANRegistry: true,
904
+ bank_identifier: '0-3',
856
905
  },
857
906
  BZ: {},
858
907
  CA: {},
@@ -871,6 +920,7 @@ export var countrySpecs = {
871
920
  bban_regexp: '^[0-9]{5}[A-Z0-9]{12}$',
872
921
  IBANRegistry: true,
873
922
  SEPA: true,
923
+ bank_identifier: '0-4',
874
924
  },
875
925
  CI: {
876
926
  chars: 28,
@@ -888,6 +938,8 @@ export var countrySpecs = {
888
938
  chars: 22,
889
939
  bban_regexp: '^[0-9]{18}$',
890
940
  IBANRegistry: true,
941
+ bank_identifier: '0-3',
942
+ account_indentifier: '8-22',
891
943
  },
892
944
  CU: {},
893
945
  CV: { chars: 25, bban_regexp: '^[0-9]{21}$' },
@@ -898,6 +950,9 @@ export var countrySpecs = {
898
950
  bban_regexp: '^[0-9]{8}[A-Z0-9]{16}$',
899
951
  IBANRegistry: true,
900
952
  SEPA: true,
953
+ branch_indentifier: '3-7',
954
+ bank_identifier: '0-2',
955
+ account_indentifier: '12-28',
901
956
  },
902
957
  CZ: {
903
958
  chars: 24,
@@ -905,18 +960,38 @@ export var countrySpecs = {
905
960
  bban_validation_func: checkCzechAndSlovakBBAN,
906
961
  IBANRegistry: true,
907
962
  SEPA: true,
963
+ bank_identifier: '0-3',
964
+ },
965
+ DE: {
966
+ chars: 22,
967
+ bban_regexp: '^[0-9]{18}$',
968
+ IBANRegistry: true,
969
+ SEPA: true,
970
+ bank_identifier: '0-7',
971
+ account_indentifier: '13-22',
908
972
  },
909
- DE: { chars: 22, bban_regexp: '^[0-9]{18}$', IBANRegistry: true, SEPA: true },
910
973
  DJ: {
911
974
  chars: 27,
912
975
  bban_regexp: '^[0-9]{23}$',
976
+ branch_indentifier: '5-9',
977
+ bank_identifier: '0-4',
978
+ account_indentifier: '14-27',
979
+ },
980
+ DK: {
981
+ chars: 18,
982
+ bban_regexp: '^[0-9]{14}$',
983
+ IBANRegistry: true,
984
+ SEPA: true,
985
+ bank_identifier: '0-3',
986
+ account_indentifier: '4-18',
913
987
  },
914
- DK: { chars: 18, bban_regexp: '^[0-9]{14}$', IBANRegistry: true, SEPA: true },
915
988
  DM: {},
916
989
  DO: {
917
990
  chars: 28,
918
991
  bban_regexp: '^[A-Z]{4}[0-9]{20}$',
919
992
  IBANRegistry: true,
993
+ bank_identifier: '0-3',
994
+ account_indentifier: '8-28',
920
995
  },
921
996
  DZ: {
922
997
  chars: 26,
@@ -929,8 +1004,17 @@ export var countrySpecs = {
929
1004
  bban_validation_func: checkEstonianBBAN,
930
1005
  IBANRegistry: true,
931
1006
  SEPA: true,
1007
+ bank_identifier: '0-1',
1008
+ account_indentifier: '8-20',
1009
+ },
1010
+ EG: {
1011
+ chars: 29,
1012
+ bban_regexp: '^[0-9]{25}',
1013
+ IBANRegistry: true,
1014
+ branch_indentifier: '4-7',
1015
+ bank_identifier: '0-3',
1016
+ account_indentifier: '17-29',
932
1017
  },
933
- EG: { chars: 29, bban_regexp: '^[0-9]{25}', IBANRegistry: true },
934
1018
  EH: {},
935
1019
  ER: {},
936
1020
  ES: {
@@ -939,6 +1023,9 @@ export var countrySpecs = {
939
1023
  bban_regexp: '^[0-9]{20}$',
940
1024
  IBANRegistry: true,
941
1025
  SEPA: true,
1026
+ branch_indentifier: '4-7',
1027
+ bank_identifier: '0-3',
1028
+ account_indentifier: '4-24',
942
1029
  },
943
1030
  ET: {},
944
1031
  FI: {
@@ -946,20 +1033,32 @@ export var countrySpecs = {
946
1033
  bban_regexp: '^[0-9]{14}$',
947
1034
  IBANRegistry: true,
948
1035
  SEPA: true,
1036
+ bank_identifier: '0-2',
1037
+ account_indentifier: '0-0',
949
1038
  },
950
1039
  FJ: {},
951
1040
  FK: {
952
1041
  chars: 18,
953
1042
  bban_regexp: '^[A-Z]{2}[0-9]{12}$',
1043
+ bank_identifier: '0-1',
1044
+ account_indentifier: '6-18',
954
1045
  },
955
1046
  FM: {},
956
- FO: { chars: 18, bban_regexp: '^[0-9]{14}$', IBANRegistry: true },
1047
+ FO: {
1048
+ chars: 18,
1049
+ bban_regexp: '^[0-9]{14}$',
1050
+ IBANRegistry: true,
1051
+ bank_identifier: '0-3',
1052
+ account_indentifier: '4-18',
1053
+ },
957
1054
  FR: {
958
1055
  chars: 27,
959
1056
  bban_regexp: '^[0-9]{10}[A-Z0-9]{11}[0-9]{2}$',
960
1057
  bban_validation_func: checkFrenchBBAN,
961
1058
  IBANRegistry: true,
962
1059
  SEPA: true,
1060
+ bank_identifier: '0-4',
1061
+ account_indentifier: '4-27',
963
1062
  },
964
1063
  GA: {
965
1064
  chars: 27,
@@ -970,12 +1069,16 @@ export var countrySpecs = {
970
1069
  bban_regexp: '^[A-Z]{4}[0-9]{14}$',
971
1070
  IBANRegistry: true,
972
1071
  SEPA: true,
1072
+ branch_indentifier: '4-9',
1073
+ bank_identifier: '0-3',
973
1074
  },
974
1075
  GD: {},
975
1076
  GE: {
976
1077
  chars: 22,
977
1078
  bban_regexp: '^[A-Z0-9]{2}[0-9]{16}$',
978
1079
  IBANRegistry: true,
1080
+ bank_identifier: '0-1',
1081
+ account_indentifier: '6-22',
979
1082
  },
980
1083
  GF: {
981
1084
  chars: 27,
@@ -989,8 +1092,16 @@ export var countrySpecs = {
989
1092
  bban_regexp: '^[A-Z]{4}[A-Z0-9]{15}$',
990
1093
  IBANRegistry: true,
991
1094
  SEPA: true,
1095
+ bank_identifier: '0-3',
1096
+ account_indentifier: '8-23',
1097
+ },
1098
+ GL: {
1099
+ chars: 18,
1100
+ bban_regexp: '^[0-9]{14}$',
1101
+ IBANRegistry: true,
1102
+ bank_identifier: '0-3',
1103
+ account_indentifier: '4-18',
992
1104
  },
993
- GL: { chars: 18, bban_regexp: '^[0-9]{14}$', IBANRegistry: true },
994
1105
  GM: {},
995
1106
  GN: {},
996
1107
  GP: {
@@ -1007,12 +1118,17 @@ export var countrySpecs = {
1007
1118
  bban_regexp: '^[0-9]{7}[A-Z0-9]{16}$',
1008
1119
  IBANRegistry: true,
1009
1120
  SEPA: true,
1121
+ branch_indentifier: '3-6',
1122
+ bank_identifier: '0-2',
1123
+ account_indentifier: '7-27',
1010
1124
  },
1011
1125
  GS: {},
1012
1126
  GT: {
1013
1127
  chars: 28,
1014
1128
  bban_regexp: '^[A-Z0-9]{24}$',
1015
1129
  IBANRegistry: true,
1130
+ bank_identifier: '0-3',
1131
+ account_indentifier: '8-28',
1016
1132
  },
1017
1133
  GU: {},
1018
1134
  GW: {
@@ -1032,6 +1148,7 @@ export var countrySpecs = {
1032
1148
  bban_validation_func: checkCroatianBBAN,
1033
1149
  IBANRegistry: true,
1034
1150
  SEPA: true,
1151
+ bank_identifier: '0-6',
1035
1152
  },
1036
1153
  HT: {},
1037
1154
  HU: {
@@ -1040,6 +1157,8 @@ export var countrySpecs = {
1040
1157
  bban_validation_func: checkHungarianBBAN,
1041
1158
  IBANRegistry: true,
1042
1159
  SEPA: true,
1160
+ branch_indentifier: '3-6',
1161
+ bank_identifier: '0-2',
1043
1162
  },
1044
1163
  ID: {},
1045
1164
  IE: {
@@ -1047,11 +1166,15 @@ export var countrySpecs = {
1047
1166
  bban_regexp: '^[A-Z0-9]{4}[0-9]{14}$',
1048
1167
  IBANRegistry: true,
1049
1168
  SEPA: true,
1169
+ branch_indentifier: '4-9',
1170
+ bank_identifier: '0-3',
1050
1171
  },
1051
1172
  IL: {
1052
1173
  chars: 23,
1053
1174
  bban_regexp: '^[0-9]{19}$',
1054
1175
  IBANRegistry: true,
1176
+ branch_indentifier: '3-5',
1177
+ bank_identifier: '0-2',
1055
1178
  },
1056
1179
  IM: {},
1057
1180
  IN: {},
@@ -1060,17 +1183,30 @@ export var countrySpecs = {
1060
1183
  chars: 23,
1061
1184
  bban_regexp: '^[A-Z]{4}[0-9]{15}$',
1062
1185
  IBANRegistry: true,
1186
+ branch_indentifier: '4-6',
1187
+ bank_identifier: '0-3',
1188
+ account_indentifier: '11-23',
1063
1189
  },
1064
1190
  IR: {
1065
1191
  chars: 26,
1066
1192
  bban_regexp: '^[0-9]{22}$',
1067
1193
  },
1068
- IS: { chars: 26, bban_regexp: '^[0-9]{22}$', IBANRegistry: true, SEPA: true },
1194
+ IS: {
1195
+ chars: 26,
1196
+ bban_regexp: '^[0-9]{22}$',
1197
+ IBANRegistry: true,
1198
+ SEPA: true,
1199
+ branch_indentifier: '2-3',
1200
+ bank_identifier: '0-1',
1201
+ },
1069
1202
  IT: {
1070
1203
  chars: 27,
1071
1204
  bban_regexp: '^[A-Z]{1}[0-9]{10}[A-Z0-9]{12}$',
1072
1205
  IBANRegistry: true,
1073
1206
  SEPA: true,
1207
+ branch_indentifier: '6-10',
1208
+ bank_identifier: '1-5',
1209
+ account_indentifier: '4-27',
1074
1210
  },
1075
1211
  JE: {},
1076
1212
  JM: {},
@@ -1078,6 +1214,8 @@ export var countrySpecs = {
1078
1214
  chars: 30,
1079
1215
  bban_regexp: '^[A-Z]{4}[0-9]{4}[A-Z0-9]{18}$',
1080
1216
  IBANRegistry: true,
1217
+ branch_indentifier: '4-7',
1218
+ bank_identifier: '4-7',
1081
1219
  },
1082
1220
  JP: {},
1083
1221
  KE: {},
@@ -1095,50 +1233,65 @@ export var countrySpecs = {
1095
1233
  chars: 30,
1096
1234
  bban_regexp: '^[A-Z]{4}[A-Z0-9]{22}$',
1097
1235
  IBANRegistry: true,
1236
+ bank_identifier: '0-3',
1237
+ account_indentifier: '20-30',
1098
1238
  },
1099
1239
  KY: {},
1100
1240
  KZ: {
1101
1241
  chars: 20,
1102
1242
  bban_regexp: '^[0-9]{3}[A-Z0-9]{13}$',
1103
1243
  IBANRegistry: true,
1244
+ bank_identifier: '0-2',
1245
+ account_indentifier: '0-20',
1104
1246
  },
1105
1247
  LA: {},
1106
1248
  LB: {
1107
1249
  chars: 28,
1108
1250
  bban_regexp: '^[0-9]{4}[A-Z0-9]{20}$',
1109
1251
  IBANRegistry: true,
1252
+ bank_identifier: '0-3',
1253
+ account_indentifier: '14-28',
1110
1254
  },
1111
1255
  LC: {
1112
1256
  chars: 32,
1113
1257
  bban_regexp: '^[A-Z]{4}[A-Z0-9]{24}$',
1114
1258
  IBANRegistry: true,
1259
+ bank_identifier: '0-3',
1260
+ account_indentifier: '8-32',
1115
1261
  },
1116
1262
  LI: {
1117
1263
  chars: 21,
1118
1264
  bban_regexp: '^[0-9]{5}[A-Z0-9]{12}$',
1119
1265
  IBANRegistry: true,
1120
1266
  SEPA: true,
1267
+ bank_identifier: '0-4',
1121
1268
  },
1122
1269
  LK: {},
1123
1270
  LR: {},
1124
1271
  LS: {},
1125
- LT: { chars: 20, bban_regexp: '^[0-9]{16}$', IBANRegistry: true, SEPA: true },
1272
+ LT: { chars: 20, bban_regexp: '^[0-9]{16}$', IBANRegistry: true, SEPA: true, bank_identifier: '0-4' },
1126
1273
  LU: {
1127
1274
  chars: 20,
1128
1275
  bban_regexp: '^[0-9]{3}[A-Z0-9]{13}$',
1129
1276
  IBANRegistry: true,
1130
1277
  SEPA: true,
1278
+ bank_identifier: '0-2',
1131
1279
  },
1132
1280
  LV: {
1133
1281
  chars: 21,
1134
1282
  bban_regexp: '^[A-Z]{4}[A-Z0-9]{13}$',
1135
1283
  IBANRegistry: true,
1136
1284
  SEPA: true,
1285
+ bank_identifier: '0-3',
1286
+ account_indentifier: '0-21',
1137
1287
  },
1138
1288
  LY: {
1139
1289
  chars: 25,
1140
1290
  bban_regexp: '^[0-9]{21}$',
1141
1291
  IBANRegistry: true,
1292
+ branch_indentifier: '3-5',
1293
+ bank_identifier: '0-2',
1294
+ account_indentifier: '10-25',
1142
1295
  },
1143
1296
  MA: {
1144
1297
  chars: 28,
@@ -1150,17 +1303,23 @@ export var countrySpecs = {
1150
1303
  bban_validation_func: checkFrenchBBAN,
1151
1304
  IBANRegistry: true,
1152
1305
  SEPA: true,
1306
+ branch_indentifier: '5-9',
1307
+ bank_identifier: '0-4',
1153
1308
  },
1154
1309
  MD: {
1155
1310
  chars: 24,
1156
1311
  bban_regexp: '^[A-Z0-9]{2}[A-Z0-9]{18}$',
1157
1312
  IBANRegistry: true,
1313
+ bank_identifier: '0-1',
1314
+ account_indentifier: '6-24',
1158
1315
  },
1159
1316
  ME: {
1160
1317
  chars: 22,
1161
1318
  bban_regexp: '^[0-9]{18}$',
1162
1319
  bban_validation_func: checkMod9710BBAN,
1163
1320
  IBANRegistry: true,
1321
+ bank_identifier: '0-2',
1322
+ account_indentifier: '4-22',
1164
1323
  },
1165
1324
  MF: {
1166
1325
  chars: 27,
@@ -1177,6 +1336,7 @@ export var countrySpecs = {
1177
1336
  bban_regexp: '^[0-9]{3}[A-Z0-9]{10}[0-9]{2}$',
1178
1337
  bban_validation_func: checkMod9710BBAN,
1179
1338
  IBANRegistry: true,
1339
+ bank_identifier: '0-2',
1180
1340
  },
1181
1341
  ML: {
1182
1342
  chars: 28,
@@ -1186,6 +1346,9 @@ export var countrySpecs = {
1186
1346
  MN: {
1187
1347
  chars: 20,
1188
1348
  bban_regexp: '^[0-9]{16}$',
1349
+ IBANRegistry: true,
1350
+ bank_identifier: '0-3',
1351
+ account_indentifier: '8-20',
1189
1352
  },
1190
1353
  MO: {},
1191
1354
  MP: {},
@@ -1198,6 +1361,9 @@ export var countrySpecs = {
1198
1361
  chars: 27,
1199
1362
  bban_regexp: '^[0-9]{23}$',
1200
1363
  IBANRegistry: true,
1364
+ branch_indentifier: '5-9',
1365
+ bank_identifier: '0-4',
1366
+ account_indentifier: '4-27',
1201
1367
  },
1202
1368
  MS: {},
1203
1369
  MT: {
@@ -1205,11 +1371,17 @@ export var countrySpecs = {
1205
1371
  bban_regexp: '^[A-Z]{4}[0-9]{5}[A-Z0-9]{18}$',
1206
1372
  IBANRegistry: true,
1207
1373
  SEPA: true,
1374
+ branch_indentifier: '4-8',
1375
+ bank_identifier: '0-3',
1376
+ account_indentifier: '15-31',
1208
1377
  },
1209
1378
  MU: {
1210
1379
  chars: 30,
1211
1380
  bban_regexp: '^[A-Z]{4}[0-9]{19}[A-Z]{3}$',
1212
1381
  IBANRegistry: true,
1382
+ branch_indentifier: '6-7',
1383
+ bank_identifier: '0-5',
1384
+ account_indentifier: '0-30',
1213
1385
  },
1214
1386
  MV: {},
1215
1387
  MW: {},
@@ -1234,12 +1406,17 @@ export var countrySpecs = {
1234
1406
  NI: {
1235
1407
  chars: 28,
1236
1408
  bban_regexp: '^[A-Z]{4}[0-9]{20}$',
1409
+ bank_identifier: '0-3',
1410
+ IBANRegistry: true,
1411
+ account_indentifier: '8-28',
1237
1412
  },
1238
1413
  NL: {
1239
1414
  chars: 18,
1240
1415
  bban_regexp: '^[A-Z]{4}[0-9]{10}$',
1241
1416
  IBANRegistry: true,
1242
1417
  SEPA: true,
1418
+ bank_identifier: '0-3',
1419
+ account_indentifier: '8-18',
1243
1420
  },
1244
1421
  NO: {
1245
1422
  chars: 15,
@@ -1247,6 +1424,8 @@ export var countrySpecs = {
1247
1424
  bban_validation_func: checkNorwayBBAN,
1248
1425
  IBANRegistry: true,
1249
1426
  SEPA: true,
1427
+ bank_identifier: '0-3',
1428
+ account_indentifier: '4-15',
1250
1429
  },
1251
1430
  NP: {},
1252
1431
  NR: {},
@@ -1266,8 +1445,17 @@ export var countrySpecs = {
1266
1445
  chars: 24,
1267
1446
  bban_regexp: '^[A-Z0-9]{4}[0-9]{16}$',
1268
1447
  IBANRegistry: true,
1448
+ bank_identifier: '0-3',
1449
+ },
1450
+ PL: {
1451
+ chars: 28,
1452
+ bban_validation_func: checkPolandBBAN,
1453
+ bban_regexp: '^[0-9]{24}$',
1454
+ IBANRegistry: true,
1455
+ SEPA: true,
1456
+ branch_indentifier: '0-7',
1457
+ account_indentifier: '2-28',
1269
1458
  },
1270
- PL: { chars: 28, bban_validation_func: checkPolandBBAN, bban_regexp: '^[0-9]{24}$', IBANRegistry: true, SEPA: true },
1271
1459
  PM: {
1272
1460
  chars: 27,
1273
1461
  bban_regexp: '^[0-9]{10}[A-Z0-9]{11}[0-9]{2}$',
@@ -1279,14 +1467,25 @@ export var countrySpecs = {
1279
1467
  chars: 29,
1280
1468
  bban_regexp: '^[A-Z0-9]{4}[0-9]{21}$',
1281
1469
  IBANRegistry: true,
1470
+ bank_identifier: '0-3',
1471
+ account_indentifier: '17-29',
1472
+ },
1473
+ PT: {
1474
+ chars: 25,
1475
+ bban_regexp: '^[0-9]{21}$',
1476
+ bban_validation_func: checkMod9710BBAN,
1477
+ IBANRegistry: true,
1478
+ SEPA: true,
1479
+ bank_identifier: '0-3',
1282
1480
  },
1283
- PT: { chars: 25, bban_regexp: '^[0-9]{21}$', bban_validation_func: checkMod9710BBAN, IBANRegistry: true, SEPA: true },
1284
1481
  PW: {},
1285
1482
  PY: {},
1286
1483
  QA: {
1287
1484
  chars: 29,
1288
1485
  bban_regexp: '^[A-Z]{4}[A-Z0-9]{21}$',
1289
1486
  IBANRegistry: true,
1487
+ bank_identifier: '0-3',
1488
+ account_indentifier: '8-29',
1290
1489
  },
1291
1490
  RE: {
1292
1491
  chars: 27,
@@ -1298,36 +1497,49 @@ export var countrySpecs = {
1298
1497
  bban_regexp: '^[A-Z]{4}[A-Z0-9]{16}$',
1299
1498
  IBANRegistry: true,
1300
1499
  SEPA: true,
1500
+ bank_identifier: '0-3',
1501
+ account_indentifier: '0-24',
1301
1502
  },
1302
1503
  RS: {
1303
1504
  chars: 22,
1304
1505
  bban_regexp: '^[0-9]{18}$',
1305
1506
  bban_validation_func: checkMod9710BBAN,
1306
1507
  IBANRegistry: true,
1508
+ bank_identifier: '0-2',
1307
1509
  },
1308
1510
  RU: {
1309
1511
  chars: 33,
1310
1512
  bban_regexp: '^[0-9]{14}[A-Z0-9]{15}$',
1311
1513
  IBANRegistry: true,
1514
+ branch_indentifier: '9-13',
1515
+ bank_identifier: '0-8',
1516
+ account_indentifier: '13-33',
1312
1517
  },
1313
1518
  RW: {},
1314
1519
  SA: {
1315
1520
  chars: 24,
1316
1521
  bban_regexp: '^[0-9]{2}[A-Z0-9]{18}$',
1317
1522
  IBANRegistry: true,
1523
+ bank_identifier: '0-1',
1524
+ account_indentifier: '12-24',
1318
1525
  },
1319
1526
  SB: {},
1320
1527
  SC: {
1321
1528
  chars: 31,
1322
1529
  bban_regexp: '^[A-Z]{4}[0-9]{20}[A-Z]{3}$',
1323
1530
  IBANRegistry: true,
1531
+ branch_indentifier: '6-7',
1532
+ bank_identifier: '0-5',
1533
+ account_indentifier: '12-28',
1324
1534
  },
1325
1535
  SD: {
1326
1536
  chars: 18,
1327
1537
  bban_regexp: '^[0-9]{14}$',
1328
1538
  IBANRegistry: true,
1539
+ bank_identifier: '0-1',
1540
+ account_indentifier: '6-18',
1329
1541
  },
1330
- SE: { chars: 24, bban_regexp: '^[0-9]{20}$', IBANRegistry: true, SEPA: true },
1542
+ SE: { chars: 24, bban_regexp: '^[0-9]{20}$', IBANRegistry: true, SEPA: true, bank_identifier: '0-2' },
1331
1543
  SG: {},
1332
1544
  SH: {},
1333
1545
  SI: {
@@ -1336,6 +1548,9 @@ export var countrySpecs = {
1336
1548
  bban_validation_func: checkMod9710BBAN,
1337
1549
  IBANRegistry: true,
1338
1550
  SEPA: true,
1551
+ branch_indentifier: '2-4',
1552
+ bank_identifier: '0-1',
1553
+ account_indentifier: '9-16',
1339
1554
  },
1340
1555
  SJ: {},
1341
1556
  SK: {
@@ -1351,6 +1566,7 @@ export var countrySpecs = {
1351
1566
  bban_regexp: '^[A-Z]{1}[0-9]{10}[A-Z0-9]{12}$',
1352
1567
  IBANRegistry: true,
1353
1568
  SEPA: true,
1569
+ branch_indentifier: '6-10',
1354
1570
  },
1355
1571
  SN: {
1356
1572
  chars: 28,
@@ -1360,6 +1576,8 @@ export var countrySpecs = {
1360
1576
  chars: 23,
1361
1577
  bban_regexp: '^[0-9]{19}$',
1362
1578
  IBANRegistry: true,
1579
+ branch_indentifier: '4-6',
1580
+ account_indentifier: '11-23',
1363
1581
  },
1364
1582
  SR: {},
1365
1583
  SS: {},
@@ -1367,11 +1585,13 @@ export var countrySpecs = {
1367
1585
  chars: 25,
1368
1586
  bban_regexp: '^[0-9]{21}$',
1369
1587
  IBANRegistry: true,
1588
+ branch_indentifier: '4-7',
1370
1589
  },
1371
1590
  SV: {
1372
1591
  chars: 28,
1373
1592
  bban_regexp: '^[A-Z]{4}[0-9]{20}$',
1374
1593
  IBANRegistry: true,
1594
+ account_indentifier: '8-28',
1375
1595
  },
1376
1596
  SX: {},
1377
1597
  SY: {},
@@ -1397,12 +1617,15 @@ export var countrySpecs = {
1397
1617
  chars: 23,
1398
1618
  bban_regexp: '^[0-9]{19}$',
1399
1619
  IBANRegistry: true,
1620
+ account_indentifier: '4-23',
1400
1621
  },
1401
1622
  TM: {},
1402
1623
  TN: {
1403
1624
  chars: 24,
1404
1625
  bban_regexp: '^[0-9]{20}$',
1405
1626
  IBANRegistry: true,
1627
+ branch_indentifier: '2-4',
1628
+ account_indentifier: '4-24',
1406
1629
  },
1407
1630
  TO: {},
1408
1631
  TR: {
@@ -1418,19 +1641,27 @@ export var countrySpecs = {
1418
1641
  chars: 29,
1419
1642
  bban_regexp: '^[0-9]{6}[A-Z0-9]{19}$',
1420
1643
  IBANRegistry: true,
1644
+ account_indentifier: '15-29',
1421
1645
  },
1422
1646
  UG: {},
1423
1647
  UM: {},
1424
1648
  US: {},
1425
1649
  UY: {},
1426
1650
  UZ: {},
1427
- VA: { chars: 22, bban_regexp: '^[0-9]{18}', IBANRegistry: true, SEPA: true },
1651
+ VA: {
1652
+ chars: 22,
1653
+ bban_regexp: '^[0-9]{18}',
1654
+ IBANRegistry: true,
1655
+ SEPA: true,
1656
+ account_indentifier: '7-22',
1657
+ },
1428
1658
  VC: {},
1429
1659
  VE: {},
1430
1660
  VG: {
1431
1661
  chars: 24,
1432
1662
  bban_regexp: '^[A-Z0-9]{4}[0-9]{16}$',
1433
1663
  IBANRegistry: true,
1664
+ account_indentifier: '8-24',
1434
1665
  },
1435
1666
  VI: {},
1436
1667
  VN: {},
@@ -1445,6 +1676,8 @@ export var countrySpecs = {
1445
1676
  chars: 20,
1446
1677
  bban_regexp: '^[0-9]{16}$',
1447
1678
  IBANRegistry: true,
1679
+ branch_indentifier: '2-3',
1680
+ account_indentifier: '4-20',
1448
1681
  },
1449
1682
  YE: {},
1450
1683
  YT: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ibantools",
3
- "version": "4.3.5",
3
+ "version": "4.3.7",
4
4
  "description": "Validation, extraction and creation of IBAN, BBAN, BIC/SWIFT numbers plus some other helpful stuff like ISO 3136-1 alpha 2 country list",
5
5
  "keywords": [
6
6
  "IBAN",
@@ -74,7 +74,7 @@
74
74
  "prettier": "^3.0.3",
75
75
  "requirejs": "^2.3.6",
76
76
  "typedoc": "^0.25.1",
77
- "typescript": "^5.2.2"
77
+ "typescript": "^5.2"
78
78
  },
79
79
  "resolutions": {
80
80
  "source-map": "^0.8.0-beta.0"