ibantools 4.3.4 → 4.3.5

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.
@@ -126,12 +126,15 @@ export interface ExtractIBANResult {
126
126
  iban: string;
127
127
  bban?: string;
128
128
  countryCode?: string;
129
+ accountNumber?: string;
130
+ branchIdentifier?: string;
131
+ bankIdentifier?: string;
129
132
  valid: boolean;
130
133
  }
131
134
  /**
132
135
  * extractIBAN
133
136
  * ```
134
- * // returns {iban: "NL91ABNA0417164300", bban: "ABNA0417164300", countryCode: "NL", valid: true}
137
+ * // returns {iban: "NL91ABNA0417164300", bban: "ABNA0417164300", countryCode: "NL", valid: true, accountNumber: '0417164300', bankIdentifier: 'ABNA'}
135
138
  * ibantools.extractIBAN("NL91 ABNA 0417 1643 00");
136
139
  * ```
137
140
  */
@@ -269,6 +272,9 @@ interface CountrySpecInternal {
269
272
  bban_validation_func?: (bban: string) => boolean;
270
273
  IBANRegistry?: boolean;
271
274
  SEPA?: boolean;
275
+ branch_indentifier?: string;
276
+ bank_identifier?: string;
277
+ account_indentifier?: string;
272
278
  }
273
279
  /**
274
280
  * Interface for Map of Country Specifications
@@ -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.5
12
12
  * @license MPL-2.0
13
13
  * @preferred
14
14
  */
@@ -229,7 +229,7 @@ exports.composeIBAN = composeIBAN;
229
229
  /**
230
230
  * extractIBAN
231
231
  * ```
232
- * // returns {iban: "NL91ABNA0417164300", bban: "ABNA0417164300", countryCode: "NL", valid: true}
232
+ * // returns {iban: "NL91ABNA0417164300", bban: "ABNA0417164300", countryCode: "NL", valid: true, accountNumber: '0417164300', bankIdentifier: 'ABNA'}
233
233
  * ibantools.extractIBAN("NL91 ABNA 0417 1643 00");
234
234
  * ```
235
235
  */
@@ -241,6 +241,25 @@ function extractIBAN(iban) {
241
241
  result.bban = eFormatIBAN.slice(4);
242
242
  result.countryCode = eFormatIBAN.slice(0, 2);
243
243
  result.valid = true;
244
+ var spec = exports.countrySpecs[result.countryCode];
245
+ if (spec.account_indentifier) {
246
+ var ac = spec.account_indentifier.split('-');
247
+ var starting = parseInt(ac[0]);
248
+ var ending = parseInt(ac[1]);
249
+ result.accountNumber = result.iban.slice(starting, ending + 1);
250
+ }
251
+ if (spec.bank_identifier) {
252
+ var ac = spec.bank_identifier.split('-');
253
+ var starting = parseInt(ac[0]);
254
+ var ending = parseInt(ac[1]);
255
+ result.bankIdentifier = result.bban.slice(starting, ending + 1);
256
+ }
257
+ if (spec.branch_indentifier) {
258
+ var ac = spec.branch_indentifier.split('-');
259
+ var starting = parseInt(ac[0]);
260
+ var ending = parseInt(ac[1]);
261
+ result.branchIdentifier = result.bban.slice(starting, ending + 1);
262
+ }
244
263
  }
245
264
  else {
246
265
  result.valid = false;
@@ -780,11 +799,16 @@ exports.countrySpecs = {
780
799
  bban_regexp: '^[0-9]{8}[A-Z0-9]{12}$',
781
800
  IBANRegistry: true,
782
801
  SEPA: true,
802
+ branch_indentifier: '4-7',
803
+ bank_identifier: '0-3',
804
+ account_indentifier: '8-24',
783
805
  },
784
806
  AE: {
785
807
  chars: 23,
786
808
  bban_regexp: '^[0-9]{3}[0-9]{16}$',
787
809
  IBANRegistry: true,
810
+ bank_identifier: '0-2',
811
+ account_indentifier: '7-23',
788
812
  },
789
813
  AF: {},
790
814
  AG: {},
@@ -793,6 +817,9 @@ exports.countrySpecs = {
793
817
  chars: 28,
794
818
  bban_regexp: '^[0-9]{8}[A-Z0-9]{16}$',
795
819
  IBANRegistry: true,
820
+ branch_indentifier: '3-7',
821
+ bank_identifier: '0-2',
822
+ account_indentifier: '12-28',
796
823
  },
797
824
  AM: {},
798
825
  AO: {
@@ -802,7 +829,7 @@ exports.countrySpecs = {
802
829
  AQ: {},
803
830
  AR: {},
804
831
  AS: {},
805
- AT: { chars: 20, bban_regexp: '^[0-9]{16}$', IBANRegistry: true, SEPA: true },
832
+ AT: { chars: 20, bban_regexp: '^[0-9]{16}$', IBANRegistry: true, SEPA: true, bank_identifier: '0-4' },
806
833
  AU: {},
807
834
  AW: {},
808
835
  AX: {
@@ -814,16 +841,28 @@ exports.countrySpecs = {
814
841
  chars: 28,
815
842
  bban_regexp: '^[A-Z]{4}[A-Z0-9]{20}$',
816
843
  IBANRegistry: true,
844
+ bank_identifier: '0-3',
845
+ account_indentifier: '4-28',
817
846
  },
818
847
  BA: {
819
848
  chars: 20,
820
849
  bban_regexp: '^[0-9]{16}$',
821
850
  bban_validation_func: checkMod9710BBAN,
822
851
  IBANRegistry: true,
852
+ branch_indentifier: '3-5',
853
+ bank_identifier: '0-2',
823
854
  },
824
855
  BB: {},
825
856
  BD: {},
826
- BE: { chars: 16, bban_regexp: '^[0-9]{12}$', bban_validation_func: checkBelgianBBAN, IBANRegistry: true, SEPA: true },
857
+ BE: {
858
+ chars: 16,
859
+ bban_regexp: '^[0-9]{12}$',
860
+ bban_validation_func: checkBelgianBBAN,
861
+ IBANRegistry: true,
862
+ SEPA: true,
863
+ bank_identifier: '0-2',
864
+ account_indentifier: '0-16',
865
+ },
827
866
  BF: {
828
867
  chars: 28,
829
868
  bban_regexp: '^[A-Z0-9]{2}[0-9]{22}$',
@@ -833,15 +872,22 @@ exports.countrySpecs = {
833
872
  bban_regexp: '^[A-Z]{4}[0-9]{6}[A-Z0-9]{8}$',
834
873
  IBANRegistry: true,
835
874
  SEPA: true,
875
+ branch_indentifier: '4-7',
876
+ bank_identifier: '0-3',
836
877
  },
837
878
  BH: {
838
879
  chars: 22,
839
880
  bban_regexp: '^[A-Z]{4}[A-Z0-9]{14}$',
840
881
  IBANRegistry: true,
882
+ bank_identifier: '0-3',
883
+ account_indentifier: '8-22',
841
884
  },
842
885
  BI: {
843
886
  chars: 27,
844
887
  bban_regexp: '^[0-9]{23}$',
888
+ branch_indentifier: '5-9',
889
+ bank_identifier: '0-4',
890
+ account_indentifier: '14-27',
845
891
  },
846
892
  BJ: {
847
893
  chars: 28,
@@ -850,7 +896,6 @@ exports.countrySpecs = {
850
896
  BL: {
851
897
  chars: 27,
852
898
  bban_regexp: '^[0-9]{10}[A-Z0-9]{11}[0-9]{2}$',
853
- IBANRegistry: true,
854
899
  },
855
900
  BM: {},
856
901
  BN: {},
@@ -860,6 +905,9 @@ exports.countrySpecs = {
860
905
  chars: 29,
861
906
  bban_regexp: '^[0-9]{23}[A-Z]{1}[A-Z0-9]{1}$',
862
907
  IBANRegistry: true,
908
+ branch_indentifier: '8-12',
909
+ bank_identifier: '0-7',
910
+ account_indentifier: '17-29',
863
911
  },
864
912
  BS: {},
865
913
  BT: {},
@@ -869,6 +917,7 @@ exports.countrySpecs = {
869
917
  chars: 28,
870
918
  bban_regexp: '^[A-Z]{4}[0-9]{4}[A-Z0-9]{16}$',
871
919
  IBANRegistry: true,
920
+ bank_identifier: '0-3',
872
921
  },
873
922
  BZ: {},
874
923
  CA: {},
@@ -887,6 +936,7 @@ exports.countrySpecs = {
887
936
  bban_regexp: '^[0-9]{5}[A-Z0-9]{12}$',
888
937
  IBANRegistry: true,
889
938
  SEPA: true,
939
+ bank_identifier: '0-4',
890
940
  },
891
941
  CI: {
892
942
  chars: 28,
@@ -904,6 +954,8 @@ exports.countrySpecs = {
904
954
  chars: 22,
905
955
  bban_regexp: '^[0-9]{18}$',
906
956
  IBANRegistry: true,
957
+ bank_identifier: '0-3',
958
+ account_indentifier: '8-22',
907
959
  },
908
960
  CU: {},
909
961
  CV: { chars: 25, bban_regexp: '^[0-9]{21}$' },
@@ -914,6 +966,9 @@ exports.countrySpecs = {
914
966
  bban_regexp: '^[0-9]{8}[A-Z0-9]{16}$',
915
967
  IBANRegistry: true,
916
968
  SEPA: true,
969
+ branch_indentifier: '3-7',
970
+ bank_identifier: '0-2',
971
+ account_indentifier: '12-28',
917
972
  },
918
973
  CZ: {
919
974
  chars: 24,
@@ -921,18 +976,38 @@ exports.countrySpecs = {
921
976
  bban_validation_func: checkCzechAndSlovakBBAN,
922
977
  IBANRegistry: true,
923
978
  SEPA: true,
979
+ bank_identifier: '0-3',
980
+ },
981
+ DE: {
982
+ chars: 22,
983
+ bban_regexp: '^[0-9]{18}$',
984
+ IBANRegistry: true,
985
+ SEPA: true,
986
+ bank_identifier: '0-7',
987
+ account_indentifier: '13-22',
924
988
  },
925
- DE: { chars: 22, bban_regexp: '^[0-9]{18}$', IBANRegistry: true, SEPA: true },
926
989
  DJ: {
927
990
  chars: 27,
928
991
  bban_regexp: '^[0-9]{23}$',
992
+ branch_indentifier: '5-9',
993
+ bank_identifier: '0-4',
994
+ account_indentifier: '14-27',
995
+ },
996
+ DK: {
997
+ chars: 18,
998
+ bban_regexp: '^[0-9]{14}$',
999
+ IBANRegistry: true,
1000
+ SEPA: true,
1001
+ bank_identifier: '0-3',
1002
+ account_indentifier: '4-18',
929
1003
  },
930
- DK: { chars: 18, bban_regexp: '^[0-9]{14}$', IBANRegistry: true, SEPA: true },
931
1004
  DM: {},
932
1005
  DO: {
933
1006
  chars: 28,
934
1007
  bban_regexp: '^[A-Z]{4}[0-9]{20}$',
935
1008
  IBANRegistry: true,
1009
+ bank_identifier: '0-3',
1010
+ account_indentifier: '8-28',
936
1011
  },
937
1012
  DZ: {
938
1013
  chars: 26,
@@ -945,8 +1020,17 @@ exports.countrySpecs = {
945
1020
  bban_validation_func: checkEstonianBBAN,
946
1021
  IBANRegistry: true,
947
1022
  SEPA: true,
1023
+ bank_identifier: '0-1',
1024
+ account_indentifier: '8-20',
1025
+ },
1026
+ EG: {
1027
+ chars: 29,
1028
+ bban_regexp: '^[0-9]{25}',
1029
+ IBANRegistry: true,
1030
+ branch_indentifier: '4-7',
1031
+ bank_identifier: '0-3',
1032
+ account_indentifier: '17-29',
948
1033
  },
949
- EG: { chars: 29, bban_regexp: '^[0-9]{25}', IBANRegistry: true },
950
1034
  EH: {},
951
1035
  ER: {},
952
1036
  ES: {
@@ -955,6 +1039,9 @@ exports.countrySpecs = {
955
1039
  bban_regexp: '^[0-9]{20}$',
956
1040
  IBANRegistry: true,
957
1041
  SEPA: true,
1042
+ branch_indentifier: '4-7',
1043
+ bank_identifier: '0-3',
1044
+ account_indentifier: '4-24',
958
1045
  },
959
1046
  ET: {},
960
1047
  FI: {
@@ -962,20 +1049,32 @@ exports.countrySpecs = {
962
1049
  bban_regexp: '^[0-9]{14}$',
963
1050
  IBANRegistry: true,
964
1051
  SEPA: true,
1052
+ bank_identifier: '0-2',
1053
+ account_indentifier: '0-0',
965
1054
  },
966
1055
  FJ: {},
967
1056
  FK: {
968
1057
  chars: 18,
969
1058
  bban_regexp: '^[A-Z]{2}[0-9]{12}$',
1059
+ bank_identifier: '0-1',
1060
+ account_indentifier: '6-18',
970
1061
  },
971
1062
  FM: {},
972
- FO: { chars: 18, bban_regexp: '^[0-9]{14}$', IBANRegistry: true },
1063
+ FO: {
1064
+ chars: 18,
1065
+ bban_regexp: '^[0-9]{14}$',
1066
+ IBANRegistry: true,
1067
+ bank_identifier: '0-3',
1068
+ account_indentifier: '4-18',
1069
+ },
973
1070
  FR: {
974
1071
  chars: 27,
975
1072
  bban_regexp: '^[0-9]{10}[A-Z0-9]{11}[0-9]{2}$',
976
1073
  bban_validation_func: checkFrenchBBAN,
977
1074
  IBANRegistry: true,
978
1075
  SEPA: true,
1076
+ bank_identifier: '0-4',
1077
+ account_indentifier: '4-27',
979
1078
  },
980
1079
  GA: {
981
1080
  chars: 27,
@@ -986,12 +1085,16 @@ exports.countrySpecs = {
986
1085
  bban_regexp: '^[A-Z]{4}[0-9]{14}$',
987
1086
  IBANRegistry: true,
988
1087
  SEPA: true,
1088
+ branch_indentifier: '4-9',
1089
+ bank_identifier: '0-3',
989
1090
  },
990
1091
  GD: {},
991
1092
  GE: {
992
1093
  chars: 22,
993
1094
  bban_regexp: '^[A-Z0-9]{2}[0-9]{16}$',
994
1095
  IBANRegistry: true,
1096
+ bank_identifier: '0-1',
1097
+ account_indentifier: '6-22',
995
1098
  },
996
1099
  GF: {
997
1100
  chars: 27,
@@ -1005,8 +1108,16 @@ exports.countrySpecs = {
1005
1108
  bban_regexp: '^[A-Z]{4}[A-Z0-9]{15}$',
1006
1109
  IBANRegistry: true,
1007
1110
  SEPA: true,
1111
+ bank_identifier: '0-3',
1112
+ account_indentifier: '8-23',
1113
+ },
1114
+ GL: {
1115
+ chars: 18,
1116
+ bban_regexp: '^[0-9]{14}$',
1117
+ IBANRegistry: true,
1118
+ bank_identifier: '0-3',
1119
+ account_indentifier: '4-18',
1008
1120
  },
1009
- GL: { chars: 18, bban_regexp: '^[0-9]{14}$', IBANRegistry: true },
1010
1121
  GM: {},
1011
1122
  GN: {},
1012
1123
  GP: {
@@ -1023,12 +1134,17 @@ exports.countrySpecs = {
1023
1134
  bban_regexp: '^[0-9]{7}[A-Z0-9]{16}$',
1024
1135
  IBANRegistry: true,
1025
1136
  SEPA: true,
1137
+ branch_indentifier: '3-6',
1138
+ bank_identifier: '0-2',
1139
+ account_indentifier: '7-27',
1026
1140
  },
1027
1141
  GS: {},
1028
1142
  GT: {
1029
1143
  chars: 28,
1030
1144
  bban_regexp: '^[A-Z0-9]{24}$',
1031
1145
  IBANRegistry: true,
1146
+ bank_identifier: '0-3',
1147
+ account_indentifier: '8-28',
1032
1148
  },
1033
1149
  GU: {},
1034
1150
  GW: {
@@ -1048,6 +1164,7 @@ exports.countrySpecs = {
1048
1164
  bban_validation_func: checkCroatianBBAN,
1049
1165
  IBANRegistry: true,
1050
1166
  SEPA: true,
1167
+ bank_identifier: '0-6',
1051
1168
  },
1052
1169
  HT: {},
1053
1170
  HU: {
@@ -1056,6 +1173,8 @@ exports.countrySpecs = {
1056
1173
  bban_validation_func: checkHungarianBBAN,
1057
1174
  IBANRegistry: true,
1058
1175
  SEPA: true,
1176
+ branch_indentifier: '3-6',
1177
+ bank_identifier: '0-2',
1059
1178
  },
1060
1179
  ID: {},
1061
1180
  IE: {
@@ -1063,11 +1182,15 @@ exports.countrySpecs = {
1063
1182
  bban_regexp: '^[A-Z0-9]{4}[0-9]{14}$',
1064
1183
  IBANRegistry: true,
1065
1184
  SEPA: true,
1185
+ branch_indentifier: '4-9',
1186
+ bank_identifier: '0-3',
1066
1187
  },
1067
1188
  IL: {
1068
1189
  chars: 23,
1069
1190
  bban_regexp: '^[0-9]{19}$',
1070
1191
  IBANRegistry: true,
1192
+ branch_indentifier: '3-5',
1193
+ bank_identifier: '0-2',
1071
1194
  },
1072
1195
  IM: {},
1073
1196
  IN: {},
@@ -1076,17 +1199,30 @@ exports.countrySpecs = {
1076
1199
  chars: 23,
1077
1200
  bban_regexp: '^[A-Z]{4}[0-9]{15}$',
1078
1201
  IBANRegistry: true,
1202
+ branch_indentifier: '4-6',
1203
+ bank_identifier: '0-3',
1204
+ account_indentifier: '11-23',
1079
1205
  },
1080
1206
  IR: {
1081
1207
  chars: 26,
1082
1208
  bban_regexp: '^[0-9]{22}$',
1083
1209
  },
1084
- IS: { chars: 26, bban_regexp: '^[0-9]{22}$', IBANRegistry: true, SEPA: true },
1210
+ IS: {
1211
+ chars: 26,
1212
+ bban_regexp: '^[0-9]{22}$',
1213
+ IBANRegistry: true,
1214
+ SEPA: true,
1215
+ branch_indentifier: '2-3',
1216
+ bank_identifier: '0-1',
1217
+ },
1085
1218
  IT: {
1086
1219
  chars: 27,
1087
1220
  bban_regexp: '^[A-Z]{1}[0-9]{10}[A-Z0-9]{12}$',
1088
1221
  IBANRegistry: true,
1089
1222
  SEPA: true,
1223
+ branch_indentifier: '6-10',
1224
+ bank_identifier: '1-5',
1225
+ account_indentifier: '4-27',
1090
1226
  },
1091
1227
  JE: {},
1092
1228
  JM: {},
@@ -1094,6 +1230,8 @@ exports.countrySpecs = {
1094
1230
  chars: 30,
1095
1231
  bban_regexp: '^[A-Z]{4}[0-9]{4}[A-Z0-9]{18}$',
1096
1232
  IBANRegistry: true,
1233
+ branch_indentifier: '4-7',
1234
+ bank_identifier: '4-7',
1097
1235
  },
1098
1236
  JP: {},
1099
1237
  KE: {},
@@ -1111,50 +1249,65 @@ exports.countrySpecs = {
1111
1249
  chars: 30,
1112
1250
  bban_regexp: '^[A-Z]{4}[A-Z0-9]{22}$',
1113
1251
  IBANRegistry: true,
1252
+ bank_identifier: '0-3',
1253
+ account_indentifier: '20-30',
1114
1254
  },
1115
1255
  KY: {},
1116
1256
  KZ: {
1117
1257
  chars: 20,
1118
1258
  bban_regexp: '^[0-9]{3}[A-Z0-9]{13}$',
1119
1259
  IBANRegistry: true,
1260
+ bank_identifier: '0-2',
1261
+ account_indentifier: '0-20',
1120
1262
  },
1121
1263
  LA: {},
1122
1264
  LB: {
1123
1265
  chars: 28,
1124
1266
  bban_regexp: '^[0-9]{4}[A-Z0-9]{20}$',
1125
1267
  IBANRegistry: true,
1268
+ bank_identifier: '0-3',
1269
+ account_indentifier: '14-28',
1126
1270
  },
1127
1271
  LC: {
1128
1272
  chars: 32,
1129
1273
  bban_regexp: '^[A-Z]{4}[A-Z0-9]{24}$',
1130
1274
  IBANRegistry: true,
1275
+ bank_identifier: '0-3',
1276
+ account_indentifier: '8-32',
1131
1277
  },
1132
1278
  LI: {
1133
1279
  chars: 21,
1134
1280
  bban_regexp: '^[0-9]{5}[A-Z0-9]{12}$',
1135
1281
  IBANRegistry: true,
1136
1282
  SEPA: true,
1283
+ bank_identifier: '0-4',
1137
1284
  },
1138
1285
  LK: {},
1139
1286
  LR: {},
1140
1287
  LS: {},
1141
- LT: { chars: 20, bban_regexp: '^[0-9]{16}$', IBANRegistry: true, SEPA: true },
1288
+ LT: { chars: 20, bban_regexp: '^[0-9]{16}$', IBANRegistry: true, SEPA: true, bank_identifier: '0-4' },
1142
1289
  LU: {
1143
1290
  chars: 20,
1144
1291
  bban_regexp: '^[0-9]{3}[A-Z0-9]{13}$',
1145
1292
  IBANRegistry: true,
1146
1293
  SEPA: true,
1294
+ bank_identifier: '0-2',
1147
1295
  },
1148
1296
  LV: {
1149
1297
  chars: 21,
1150
1298
  bban_regexp: '^[A-Z]{4}[A-Z0-9]{13}$',
1151
1299
  IBANRegistry: true,
1152
1300
  SEPA: true,
1301
+ bank_identifier: '0-3',
1302
+ account_indentifier: '0-21',
1153
1303
  },
1154
1304
  LY: {
1155
1305
  chars: 25,
1156
1306
  bban_regexp: '^[0-9]{21}$',
1157
1307
  IBANRegistry: true,
1308
+ branch_indentifier: '3-5',
1309
+ bank_identifier: '0-2',
1310
+ account_indentifier: '10-25',
1158
1311
  },
1159
1312
  MA: {
1160
1313
  chars: 28,
@@ -1166,17 +1319,23 @@ exports.countrySpecs = {
1166
1319
  bban_validation_func: checkFrenchBBAN,
1167
1320
  IBANRegistry: true,
1168
1321
  SEPA: true,
1322
+ branch_indentifier: '5-9',
1323
+ bank_identifier: '0-4',
1169
1324
  },
1170
1325
  MD: {
1171
1326
  chars: 24,
1172
1327
  bban_regexp: '^[A-Z0-9]{2}[A-Z0-9]{18}$',
1173
1328
  IBANRegistry: true,
1329
+ bank_identifier: '0-1',
1330
+ account_indentifier: '6-24',
1174
1331
  },
1175
1332
  ME: {
1176
1333
  chars: 22,
1177
1334
  bban_regexp: '^[0-9]{18}$',
1178
1335
  bban_validation_func: checkMod9710BBAN,
1179
1336
  IBANRegistry: true,
1337
+ bank_identifier: '0-2',
1338
+ account_indentifier: '4-22',
1180
1339
  },
1181
1340
  MF: {
1182
1341
  chars: 27,
@@ -1193,6 +1352,7 @@ exports.countrySpecs = {
1193
1352
  bban_regexp: '^[0-9]{3}[A-Z0-9]{10}[0-9]{2}$',
1194
1353
  bban_validation_func: checkMod9710BBAN,
1195
1354
  IBANRegistry: true,
1355
+ bank_identifier: '0-2',
1196
1356
  },
1197
1357
  ML: {
1198
1358
  chars: 28,
@@ -1202,6 +1362,9 @@ exports.countrySpecs = {
1202
1362
  MN: {
1203
1363
  chars: 20,
1204
1364
  bban_regexp: '^[0-9]{16}$',
1365
+ IBANRegistry: true,
1366
+ bank_identifier: '0-3',
1367
+ account_indentifier: '8-20',
1205
1368
  },
1206
1369
  MO: {},
1207
1370
  MP: {},
@@ -1214,6 +1377,9 @@ exports.countrySpecs = {
1214
1377
  chars: 27,
1215
1378
  bban_regexp: '^[0-9]{23}$',
1216
1379
  IBANRegistry: true,
1380
+ branch_indentifier: '5-9',
1381
+ bank_identifier: '0-4',
1382
+ account_indentifier: '4-27',
1217
1383
  },
1218
1384
  MS: {},
1219
1385
  MT: {
@@ -1221,11 +1387,17 @@ exports.countrySpecs = {
1221
1387
  bban_regexp: '^[A-Z]{4}[0-9]{5}[A-Z0-9]{18}$',
1222
1388
  IBANRegistry: true,
1223
1389
  SEPA: true,
1390
+ branch_indentifier: '4-8',
1391
+ bank_identifier: '0-3',
1392
+ account_indentifier: '15-31',
1224
1393
  },
1225
1394
  MU: {
1226
1395
  chars: 30,
1227
1396
  bban_regexp: '^[A-Z]{4}[0-9]{19}[A-Z]{3}$',
1228
1397
  IBANRegistry: true,
1398
+ branch_indentifier: '6-7',
1399
+ bank_identifier: '0-5',
1400
+ account_indentifier: '0-30',
1229
1401
  },
1230
1402
  MV: {},
1231
1403
  MW: {},
@@ -1250,12 +1422,17 @@ exports.countrySpecs = {
1250
1422
  NI: {
1251
1423
  chars: 28,
1252
1424
  bban_regexp: '^[A-Z]{4}[0-9]{20}$',
1425
+ bank_identifier: '0-3',
1426
+ IBANRegistry: true,
1427
+ account_indentifier: '8-28',
1253
1428
  },
1254
1429
  NL: {
1255
1430
  chars: 18,
1256
1431
  bban_regexp: '^[A-Z]{4}[0-9]{10}$',
1257
1432
  IBANRegistry: true,
1258
1433
  SEPA: true,
1434
+ bank_identifier: '0-3',
1435
+ account_indentifier: '8-18',
1259
1436
  },
1260
1437
  NO: {
1261
1438
  chars: 15,
@@ -1263,6 +1440,8 @@ exports.countrySpecs = {
1263
1440
  bban_validation_func: checkNorwayBBAN,
1264
1441
  IBANRegistry: true,
1265
1442
  SEPA: true,
1443
+ bank_identifier: '0-3',
1444
+ account_indentifier: '4-15',
1266
1445
  },
1267
1446
  NP: {},
1268
1447
  NR: {},
@@ -1282,8 +1461,17 @@ exports.countrySpecs = {
1282
1461
  chars: 24,
1283
1462
  bban_regexp: '^[A-Z0-9]{4}[0-9]{16}$',
1284
1463
  IBANRegistry: true,
1464
+ bank_identifier: '0-3',
1465
+ },
1466
+ PL: {
1467
+ chars: 28,
1468
+ bban_validation_func: checkPolandBBAN,
1469
+ bban_regexp: '^[0-9]{24}$',
1470
+ IBANRegistry: true,
1471
+ SEPA: true,
1472
+ branch_indentifier: '0-7',
1473
+ account_indentifier: '2-28',
1285
1474
  },
1286
- PL: { chars: 28, bban_validation_func: checkPolandBBAN, bban_regexp: '^[0-9]{24}$', IBANRegistry: true, SEPA: true },
1287
1475
  PM: {
1288
1476
  chars: 27,
1289
1477
  bban_regexp: '^[0-9]{10}[A-Z0-9]{11}[0-9]{2}$',
@@ -1295,14 +1483,25 @@ exports.countrySpecs = {
1295
1483
  chars: 29,
1296
1484
  bban_regexp: '^[A-Z0-9]{4}[0-9]{21}$',
1297
1485
  IBANRegistry: true,
1486
+ bank_identifier: '0-3',
1487
+ account_indentifier: '17-29',
1488
+ },
1489
+ PT: {
1490
+ chars: 25,
1491
+ bban_regexp: '^[0-9]{21}$',
1492
+ bban_validation_func: checkMod9710BBAN,
1493
+ IBANRegistry: true,
1494
+ SEPA: true,
1495
+ bank_identifier: '0-3',
1298
1496
  },
1299
- PT: { chars: 25, bban_regexp: '^[0-9]{21}$', bban_validation_func: checkMod9710BBAN, IBANRegistry: true, SEPA: true },
1300
1497
  PW: {},
1301
1498
  PY: {},
1302
1499
  QA: {
1303
1500
  chars: 29,
1304
1501
  bban_regexp: '^[A-Z]{4}[A-Z0-9]{21}$',
1305
1502
  IBANRegistry: true,
1503
+ bank_identifier: '0-3',
1504
+ account_indentifier: '8-29',
1306
1505
  },
1307
1506
  RE: {
1308
1507
  chars: 27,
@@ -1314,36 +1513,49 @@ exports.countrySpecs = {
1314
1513
  bban_regexp: '^[A-Z]{4}[A-Z0-9]{16}$',
1315
1514
  IBANRegistry: true,
1316
1515
  SEPA: true,
1516
+ bank_identifier: '0-3',
1517
+ account_indentifier: '0-24',
1317
1518
  },
1318
1519
  RS: {
1319
1520
  chars: 22,
1320
1521
  bban_regexp: '^[0-9]{18}$',
1321
1522
  bban_validation_func: checkMod9710BBAN,
1322
1523
  IBANRegistry: true,
1524
+ bank_identifier: '0-2',
1323
1525
  },
1324
1526
  RU: {
1325
1527
  chars: 33,
1326
1528
  bban_regexp: '^[0-9]{14}[A-Z0-9]{15}$',
1327
1529
  IBANRegistry: true,
1530
+ branch_indentifier: '9-13',
1531
+ bank_identifier: '0-8',
1532
+ account_indentifier: '13-33',
1328
1533
  },
1329
1534
  RW: {},
1330
1535
  SA: {
1331
1536
  chars: 24,
1332
1537
  bban_regexp: '^[0-9]{2}[A-Z0-9]{18}$',
1333
1538
  IBANRegistry: true,
1539
+ bank_identifier: '0-1',
1540
+ account_indentifier: '12-24',
1334
1541
  },
1335
1542
  SB: {},
1336
1543
  SC: {
1337
1544
  chars: 31,
1338
1545
  bban_regexp: '^[A-Z]{4}[0-9]{20}[A-Z]{3}$',
1339
1546
  IBANRegistry: true,
1547
+ branch_indentifier: '6-7',
1548
+ bank_identifier: '0-5',
1549
+ account_indentifier: '12-28',
1340
1550
  },
1341
1551
  SD: {
1342
1552
  chars: 18,
1343
1553
  bban_regexp: '^[0-9]{14}$',
1344
1554
  IBANRegistry: true,
1555
+ bank_identifier: '0-1',
1556
+ account_indentifier: '6-18',
1345
1557
  },
1346
- SE: { chars: 24, bban_regexp: '^[0-9]{20}$', IBANRegistry: true, SEPA: true },
1558
+ SE: { chars: 24, bban_regexp: '^[0-9]{20}$', IBANRegistry: true, SEPA: true, bank_identifier: '0-2' },
1347
1559
  SG: {},
1348
1560
  SH: {},
1349
1561
  SI: {
@@ -1352,6 +1564,8 @@ exports.countrySpecs = {
1352
1564
  bban_validation_func: checkMod9710BBAN,
1353
1565
  IBANRegistry: true,
1354
1566
  SEPA: true,
1567
+ bank_identifier: '-1-4',
1568
+ account_indentifier: '4-19',
1355
1569
  },
1356
1570
  SJ: {},
1357
1571
  SK: {
@@ -1367,6 +1581,7 @@ exports.countrySpecs = {
1367
1581
  bban_regexp: '^[A-Z]{1}[0-9]{10}[A-Z0-9]{12}$',
1368
1582
  IBANRegistry: true,
1369
1583
  SEPA: true,
1584
+ branch_indentifier: '6-10',
1370
1585
  },
1371
1586
  SN: {
1372
1587
  chars: 28,
@@ -1376,6 +1591,8 @@ exports.countrySpecs = {
1376
1591
  chars: 23,
1377
1592
  bban_regexp: '^[0-9]{19}$',
1378
1593
  IBANRegistry: true,
1594
+ branch_indentifier: '4-6',
1595
+ account_indentifier: '11-23',
1379
1596
  },
1380
1597
  SR: {},
1381
1598
  SS: {},
@@ -1383,11 +1600,13 @@ exports.countrySpecs = {
1383
1600
  chars: 25,
1384
1601
  bban_regexp: '^[0-9]{21}$',
1385
1602
  IBANRegistry: true,
1603
+ branch_indentifier: '4-7',
1386
1604
  },
1387
1605
  SV: {
1388
1606
  chars: 28,
1389
1607
  bban_regexp: '^[A-Z]{4}[0-9]{20}$',
1390
1608
  IBANRegistry: true,
1609
+ account_indentifier: '8-28',
1391
1610
  },
1392
1611
  SX: {},
1393
1612
  SY: {},
@@ -1413,12 +1632,15 @@ exports.countrySpecs = {
1413
1632
  chars: 23,
1414
1633
  bban_regexp: '^[0-9]{19}$',
1415
1634
  IBANRegistry: true,
1635
+ account_indentifier: '4-23',
1416
1636
  },
1417
1637
  TM: {},
1418
1638
  TN: {
1419
1639
  chars: 24,
1420
1640
  bban_regexp: '^[0-9]{20}$',
1421
1641
  IBANRegistry: true,
1642
+ branch_indentifier: '2-4',
1643
+ account_indentifier: '4-24',
1422
1644
  },
1423
1645
  TO: {},
1424
1646
  TR: {
@@ -1434,19 +1656,27 @@ exports.countrySpecs = {
1434
1656
  chars: 29,
1435
1657
  bban_regexp: '^[0-9]{6}[A-Z0-9]{19}$',
1436
1658
  IBANRegistry: true,
1659
+ account_indentifier: '15-29',
1437
1660
  },
1438
1661
  UG: {},
1439
1662
  UM: {},
1440
1663
  US: {},
1441
1664
  UY: {},
1442
1665
  UZ: {},
1443
- VA: { chars: 22, bban_regexp: '^[0-9]{18}', IBANRegistry: true, SEPA: true },
1666
+ VA: {
1667
+ chars: 22,
1668
+ bban_regexp: '^[0-9]{18}',
1669
+ IBANRegistry: true,
1670
+ SEPA: true,
1671
+ account_indentifier: '7-22',
1672
+ },
1444
1673
  VC: {},
1445
1674
  VE: {},
1446
1675
  VG: {
1447
1676
  chars: 24,
1448
1677
  bban_regexp: '^[A-Z0-9]{4}[0-9]{16}$',
1449
1678
  IBANRegistry: true,
1679
+ account_indentifier: '8-24',
1450
1680
  },
1451
1681
  VI: {},
1452
1682
  VN: {},
@@ -1461,6 +1691,8 @@ exports.countrySpecs = {
1461
1691
  chars: 20,
1462
1692
  bban_regexp: '^[0-9]{16}$',
1463
1693
  IBANRegistry: true,
1694
+ branch_indentifier: '2-3',
1695
+ account_indentifier: '4-20',
1464
1696
  },
1465
1697
  YE: {},
1466
1698
  YT: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ibantools",
3
- "version": "4.3.4",
3
+ "version": "4.3.5",
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",
@@ -10,6 +10,7 @@
10
10
  "SWIFT",
11
11
  "ISO 3136-1 alpha-2"
12
12
  ],
13
+ "sideEffects": false,
13
14
  "homepage": "https://github.com/Simplify/ibantools",
14
15
  "bugs": "https://github.com/Simplify/ibantools/issues",
15
16
  "main": "build/ibantools.js",
@@ -42,7 +43,7 @@
42
43
  "build-module": "rm -rf jsnext && npx tsc src/*.ts --target es5 --module es2015 --outDir ./jsnext/",
43
44
  "test": "npm run build && mocha 'test/**/*.js'",
44
45
  "karma": "karma start --single-run",
45
- "coverage": "nyc mocha && nyc report --reporter=text-lcov | coveralls",
46
+ "coverage": "nyc mocha && nyc report --reporter=text-lcov > test.lcov",
46
47
  "lint": "eslint 'src/**/*.ts' 'test/**/*.js'",
47
48
  "prepare": "npm run build-node",
48
49
  "docs": "typedoc src/ibantools.ts",
@@ -54,14 +55,14 @@
54
55
  },
55
56
  "license": "MPL-2.0",
56
57
  "devDependencies": {
57
- "@typescript-eslint/eslint-plugin": "^5.0.0",
58
- "@typescript-eslint/parser": "^5.0.0",
58
+ "@typescript-eslint/eslint-plugin": "^6.0.0",
59
+ "@typescript-eslint/parser": "^6.0.0",
59
60
  "chai": "^4.3.4",
60
- "coveralls": "^3.1.1",
61
+ "coveralls-next": "^4.2.0",
61
62
  "docdash": "^2.0.0",
62
63
  "eslint": "^8.0.0",
63
64
  "eslint-config-prettier": "^9.0.0",
64
- "eslint-plugin-prettier": "^4.0.0",
65
+ "eslint-plugin-prettier": "^5.0.0",
65
66
  "jasmine-core": "^5.0.0",
66
67
  "karma": "^6.3.4",
67
68
  "karma-chrome-launcher": "^3.1",
@@ -70,10 +71,10 @@
70
71
  "mocha": "^10.0.0",
71
72
  "mocha-lcov-reporter": "^1.2.0",
72
73
  "nyc": "^15.1.0",
73
- "prettier": "^2.3.2",
74
+ "prettier": "^3.0.3",
74
75
  "requirejs": "^2.3.6",
75
- "typedoc": "^0.24.1",
76
- "typescript": "^5.0.2"
76
+ "typedoc": "^0.25.1",
77
+ "typescript": "^5.2.2"
77
78
  },
78
79
  "resolutions": {
79
80
  "source-map": "^0.8.0-beta.0"