ngx-iban-validator 1.2.2 → 1.2.4
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.
- package/CHANGELOG.md +120 -0
- package/LICENCE +21 -0
- package/README.md +59 -262
- package/biome.jsonc +86 -0
- package/dist/LICENCE +21 -0
- package/dist/README.md +59 -262
- package/dist/code-lengths.d.ts +1 -1
- package/dist/code-lengths.js +6 -6
- package/dist/iban.validator.d.ts +3 -11
- package/dist/iban.validator.js +10 -10
- package/dist/index.d.ts +2 -1
- package/dist/index.js +1 -1
- package/dist/types.d.ts +9 -0
- package/package.json +24 -11
- package/.vscode/settings.json +0 -3
- package/dist/iban.validator.spec.js +0 -386
- /package/dist/{iban.validator.spec.d.ts → types.js} +0 -0
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,120 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to the **NGX IBAN Validator** project will be documented in this file.
|
|
4
|
+
|
|
5
|
+
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
|
|
6
|
+
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
|
7
|
+
|
|
8
|
+
## [1.2.4] - 2026-04-12
|
|
9
|
+
|
|
10
|
+
### Fixed
|
|
11
|
+
|
|
12
|
+
- **Algeria**: (DZ) length 26 -> 24
|
|
13
|
+
|
|
14
|
+
### Updated
|
|
15
|
+
|
|
16
|
+
- **Docs**: Updated Angular example in README to use the new @if syntax.
|
|
17
|
+
- **Demo apps - Angular**: Updated to Angular 20.3.18
|
|
18
|
+
|
|
19
|
+
## [1.2.3] - 2024-06-08
|
|
20
|
+
|
|
21
|
+
- Switch to pnpm as default package manager, setup monorepo structure, added demo apps and docs to repo
|
|
22
|
+
- Updated typescript and other dev dependencies
|
|
23
|
+
- Refractor validate function
|
|
24
|
+
|
|
25
|
+
## [1.2.2] - 2024-06-08
|
|
26
|
+
|
|
27
|
+
### Added
|
|
28
|
+
|
|
29
|
+
- **Yemen** YE
|
|
30
|
+
|
|
31
|
+
### Updated
|
|
32
|
+
|
|
33
|
+
- **Validate function**: don't return countryUnsupported error if input is for example 'YE' country is supported but length is invalid so instead codeLengthInvalid error will be returned
|
|
34
|
+
- **Tests**
|
|
35
|
+
- **Docs**
|
|
36
|
+
|
|
37
|
+
## [1.2.1] - 2024-11-07
|
|
38
|
+
|
|
39
|
+
### Updated
|
|
40
|
+
|
|
41
|
+
- **Burundi**: (BI) length 16 -> 27
|
|
42
|
+
- **Nicaragua**: (NI) length 32 -> 28
|
|
43
|
+
|
|
44
|
+
## [1.2.0] - 2024-20-03
|
|
45
|
+
|
|
46
|
+
### Updated
|
|
47
|
+
|
|
48
|
+
- **Docs**
|
|
49
|
+
|
|
50
|
+
## [1.1.9] - 2024-10-03
|
|
51
|
+
|
|
52
|
+
### Added
|
|
53
|
+
|
|
54
|
+
- **Sultanate of Oman** OM
|
|
55
|
+
|
|
56
|
+
## [1.1.8] - 2023-19-09
|
|
57
|
+
|
|
58
|
+
### Added
|
|
59
|
+
|
|
60
|
+
- **Falkland Islands** FK
|
|
61
|
+
|
|
62
|
+
## [1.1.7] - 2023-29-07
|
|
63
|
+
|
|
64
|
+
### Added
|
|
65
|
+
|
|
66
|
+
- **Djibouti** DJ
|
|
67
|
+
- **Somalia** SO
|
|
68
|
+
|
|
69
|
+
## [1.1.6] - 2023-30-06
|
|
70
|
+
|
|
71
|
+
### Updated
|
|
72
|
+
|
|
73
|
+
- **Error** structure
|
|
74
|
+
- **Value** can be passed directly as a string or part of the object.
|
|
75
|
+
- If value is passed as a part of object same logic as for form validation is applied:
|
|
76
|
+
- If IBAN is valid as result of validation **null** is returned.
|
|
77
|
+
- If IBAN is invalid and some of the checks fail IBANValidationResult object is returned containing more info about error.
|
|
78
|
+
- If value is passed as a string:
|
|
79
|
+
- For valid and invalid IBAN IBANValidationResult object is returned.
|
|
80
|
+
|
|
81
|
+
### Fixed
|
|
82
|
+
|
|
83
|
+
- Return null for valid form field to fix issue with disabling | enabling buttons
|
|
84
|
+
- Thnx to @pramodEE for reporting the issue
|
|
85
|
+
|
|
86
|
+
## [1.1.5] - 2023-23-06
|
|
87
|
+
|
|
88
|
+
### Added
|
|
89
|
+
|
|
90
|
+
- Additional pattern validation
|
|
91
|
+
- More tests to improve test coverage
|
|
92
|
+
- Countries: Algeria, Angola, Benin, Burkina Faso, Burundi, Cameroon, Cape Verde, Central African Republic, Chad, Comoros, Congo, Equatorial Guinea, Gabon, Guinea-Bissau, Honduras, Iran, Ivory Coast, Madagascar, Mali, Mongolia, Morocco, Mozambique, Nicaragua, Niger, Russia, Senegal, Togo
|
|
93
|
+
|
|
94
|
+
## [1.1.4] - 2023-04-10
|
|
95
|
+
|
|
96
|
+
### Fixed
|
|
97
|
+
|
|
98
|
+
- Avoid Angular warnings for old CommonJS module usage (see https://angular.io/guide/build#configuring-commonjs-dependencies)
|
|
99
|
+
|
|
100
|
+
### Changed
|
|
101
|
+
|
|
102
|
+
- Replaced mocha and chai with JEST for tests
|
|
103
|
+
|
|
104
|
+
## [1.1.3] - 2022-04-10
|
|
105
|
+
|
|
106
|
+
### Added
|
|
107
|
+
|
|
108
|
+
- Countries: Vatican, Libya, Sao Tome and Principe, Sudan
|
|
109
|
+
- Tests
|
|
110
|
+
- Mocha and Chai for testing
|
|
111
|
+
|
|
112
|
+
### Updated
|
|
113
|
+
|
|
114
|
+
- **Length**: for LC Saint Lucia from 30 to 32
|
|
115
|
+
|
|
116
|
+
## [1.1.2] - 2022-04-10
|
|
117
|
+
|
|
118
|
+
### Updated
|
|
119
|
+
|
|
120
|
+
- **Length**: for CR to 22 - @freddy36
|
package/LICENCE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Samir Kahvedzic
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -2,30 +2,49 @@
|
|
|
2
2
|
|
|
3
3
|
IBAN Validator for your web application forms ([Angular](#angular), [React](#react), Vue, ...), comes without any dependencies and can be used as a standalone function in any JS project. It can perform format, digit and length IBAN validations. Currently [112 countries](#supported-countries) are supported.
|
|
4
4
|
|
|
5
|
+
## Features
|
|
6
|
+
|
|
7
|
+
- Zero external dependencies
|
|
8
|
+
- Works in Node.js and all modern browsers
|
|
9
|
+
- Works with TypeScript and plain JS
|
|
10
|
+
|
|
5
11
|
## Content
|
|
6
12
|
|
|
7
13
|
- [Install](#install)
|
|
8
|
-
- [
|
|
14
|
+
- [Basic usage](#basic-usage)
|
|
9
15
|
- [Error Response](#error-response)
|
|
10
16
|
- [Use as a form validator](#use-as-a-form-validator)
|
|
11
17
|
- [Angular example](#angular)
|
|
12
18
|
- [React example](#react)
|
|
13
19
|
- [Demo Applications](#demo)
|
|
14
|
-
- [Supported countries](
|
|
15
|
-
- [
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
- [Changelog](#changelog)
|
|
20
|
+
- [Supported countries](https://github.com/SKaDiZZ/ngx-iban-validator/blob/master/SUPPORTED_COUNTRIES.md)
|
|
21
|
+
- [Changelog](https://github.com/SKaDiZZ/ngx-iban-validator/blob/master/CHANGELOG.md)
|
|
22
|
+
- [Contributing](https://github.com/SKaDiZZ/ngx-iban-validator/blob/master/CONTRIBUTING.md)
|
|
23
|
+
- [Code of Conduct](https://github.com/SKaDiZZ/ngx-iban-validator/blob/master/CODE_OF_CONDUCT.md)
|
|
24
|
+
- [License](https://github.com/SKaDiZZ/ngx-iban-validator/blob/master/LICENCE)
|
|
20
25
|
- [Read more](#read-more)
|
|
21
26
|
|
|
22
27
|
## Install
|
|
23
28
|
|
|
29
|
+
**npm**
|
|
30
|
+
|
|
31
|
+
```bash
|
|
32
|
+
npm i ngx-iban-validator
|
|
33
|
+
```
|
|
34
|
+
|
|
35
|
+
**pnpm**
|
|
36
|
+
|
|
24
37
|
```bash
|
|
25
|
-
|
|
38
|
+
pnpm add ngx-iban-validator
|
|
26
39
|
```
|
|
27
40
|
|
|
28
|
-
|
|
41
|
+
**yarn**
|
|
42
|
+
|
|
43
|
+
```bash
|
|
44
|
+
yarn add ngx-iban-validator
|
|
45
|
+
```
|
|
46
|
+
|
|
47
|
+
## Basic usage
|
|
29
48
|
|
|
30
49
|
You can use validateIBAN function independently from any forms.
|
|
31
50
|
|
|
@@ -38,7 +57,7 @@ Value can be passed as part of object in this case validation flow will be the s
|
|
|
38
57
|
```typescript
|
|
39
58
|
const ibanIsInvalid =
|
|
40
59
|
validateIBAN({
|
|
41
|
-
value:
|
|
60
|
+
value: 'AL35202111090000000001234567',
|
|
42
61
|
}) !== null;
|
|
43
62
|
```
|
|
44
63
|
|
|
@@ -53,9 +72,9 @@ const ibanIsInvalid = validateIBAN("AL35202111090000000001234567").ibanInvalid;
|
|
|
53
72
|
### NodeJS
|
|
54
73
|
|
|
55
74
|
```javascript
|
|
56
|
-
const ibanValidator = require(
|
|
75
|
+
const ibanValidator = require('ngx-iban-validator');
|
|
57
76
|
const ibanIsInvalid = ibanValidator.validateIBAN(
|
|
58
|
-
|
|
77
|
+
'BA393385804800211234'
|
|
59
78
|
).ibanInvalid;
|
|
60
79
|
```
|
|
61
80
|
|
|
@@ -68,7 +87,7 @@ const ibanIsInvalid = ibanValidator.validateIBAN(
|
|
|
68
87
|
```typescript
|
|
69
88
|
export interface IBANValidationResult {
|
|
70
89
|
ibanInvalid: boolean;
|
|
71
|
-
error: IBANError;
|
|
90
|
+
error: IBANError | null;
|
|
72
91
|
}
|
|
73
92
|
|
|
74
93
|
export interface IBANError {
|
|
@@ -87,21 +106,20 @@ Error object contains more details about validation error. You can display error
|
|
|
87
106
|
Import validateIBAN function from ngx-iban-validator package into your component file. Add validateIBAN to your form validators array.
|
|
88
107
|
|
|
89
108
|
```ts
|
|
90
|
-
import { Component, inject } from
|
|
91
|
-
import { NgIf } from "@angular/common";
|
|
109
|
+
import { Component, inject } from '@angular/core';
|
|
92
110
|
import {
|
|
93
111
|
FormBuilder,
|
|
94
112
|
FormGroup,
|
|
95
113
|
ReactiveFormsModule,
|
|
96
114
|
Validators,
|
|
97
|
-
} from
|
|
115
|
+
} from '@angular/forms';
|
|
98
116
|
|
|
99
|
-
import { validateIBAN } from
|
|
117
|
+
import { validateIBAN } from 'ngx-iban-validator';
|
|
100
118
|
|
|
101
119
|
@Component({
|
|
102
|
-
selector:
|
|
120
|
+
selector: 'my-app',
|
|
103
121
|
standalone: true,
|
|
104
|
-
imports: [
|
|
122
|
+
imports: [ReactiveFormsModule],
|
|
105
123
|
template: `
|
|
106
124
|
<div class="page">
|
|
107
125
|
<form [formGroup]="ibanForm" (ngSubmit)="submit(ibanForm)">
|
|
@@ -111,27 +129,19 @@ import { validateIBAN } from "ngx-iban-validator";
|
|
|
111
129
|
<button [disabled]="ibanForm.invalid">Submit</button>
|
|
112
130
|
</div>
|
|
113
131
|
<div class="validation-errors">
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
IBAN Code length is invalid
|
|
128
|
-
</span>
|
|
129
|
-
<span
|
|
130
|
-
*ngIf="ibanForm.get('iban')?.errors?.['error']['patternInvalid']"
|
|
131
|
-
>
|
|
132
|
-
IBAN Code pattern is invalid
|
|
133
|
-
</span>
|
|
134
|
-
</small>
|
|
132
|
+
@if (ibanForm.get('iban')?.errors?.['ibanInvalid']) {
|
|
133
|
+
<small>
|
|
134
|
+
@if (ibanForm.get('iban')?.errors?.['error']['countryUnsupported']) {
|
|
135
|
+
<span>Country not supported</span>
|
|
136
|
+
}
|
|
137
|
+
@if (ibanForm.get('iban')?.errors?.['error']['codeLengthInvalid']) {
|
|
138
|
+
<span>IBAN Code length is invalid</span>
|
|
139
|
+
}
|
|
140
|
+
@if (ibanForm.get('iban')?.errors?.['error']['patternInvalid']) {
|
|
141
|
+
<span>IBAN Code pattern is invalid</span>
|
|
142
|
+
}
|
|
143
|
+
</small>
|
|
144
|
+
}
|
|
135
145
|
</div>
|
|
136
146
|
</form>
|
|
137
147
|
</div>
|
|
@@ -180,14 +190,15 @@ export class App {
|
|
|
180
190
|
### React
|
|
181
191
|
|
|
182
192
|
```tsx
|
|
183
|
-
import { useState } from
|
|
193
|
+
import { useState } from 'react';
|
|
194
|
+
|
|
184
195
|
import {
|
|
185
|
-
IBANError,
|
|
186
|
-
IBANValidationResult,
|
|
196
|
+
type IBANError,
|
|
197
|
+
type IBANValidationResult,
|
|
187
198
|
validateIBAN,
|
|
188
|
-
} from
|
|
199
|
+
} from 'ngx-iban-validator';
|
|
189
200
|
|
|
190
|
-
import
|
|
201
|
+
import './App.css';
|
|
191
202
|
|
|
192
203
|
function App() {
|
|
193
204
|
const [error, setError] = useState<IBANError | null>(null);
|
|
@@ -214,12 +225,12 @@ function App() {
|
|
|
214
225
|
const handleSubmit = (event: React.FormEvent<HTMLFormElement>) => {
|
|
215
226
|
event.preventDefault();
|
|
216
227
|
const formData = new FormData(event.currentTarget);
|
|
217
|
-
const iban = formData.get(
|
|
228
|
+
const iban = formData.get('iban') as string;
|
|
218
229
|
const validation = validate(iban);
|
|
219
230
|
if (validation) {
|
|
220
|
-
alert(
|
|
231
|
+
alert(`IBAN: ${iban}, is valid!`);
|
|
221
232
|
} else {
|
|
222
|
-
alert(
|
|
233
|
+
alert(`IBAN: ${iban}, is invalid!`);
|
|
223
234
|
}
|
|
224
235
|
};
|
|
225
236
|
|
|
@@ -269,220 +280,6 @@ Check demo applications for usage examples:
|
|
|
269
280
|
- [Angular - Demo Application](https://stackblitz.com/edit/stackblitz-starters-d6zn46?file=src%2Fmain.ts)
|
|
270
281
|
- [React - Demo Application](https://stackblitz.com/edit/vitejs-vite-mhe5gj?file=src%2FApp.tsx)
|
|
271
282
|
|
|
272
|
-
###
|
|
273
|
-
|
|
274
|
-
# Supported countries
|
|
275
|
-
|
|
276
|
-
####
|
|
277
|
-
|
|
278
|
-
<details>
|
|
279
|
-
<summary>
|
|
280
|
-
Click here to expand list of supported countries
|
|
281
|
-
</summary>
|
|
282
|
-
|
|
283
|
-
| No | Country | Country Code | Length |
|
|
284
|
-
| --- | ------------------------ | ------------ | ------ |
|
|
285
|
-
| 1 | Albania | AL | 28 |
|
|
286
|
-
| 2 | Algeria | DZ | 26 |
|
|
287
|
-
| 3 | Andorra | AD | 24 |
|
|
288
|
-
| 4 | Angola | AO | 25 |
|
|
289
|
-
| 5 | Austria | AT | 20 |
|
|
290
|
-
| 6 | Azerbaijan | AZ | 28 |
|
|
291
|
-
| 7 | Bahrain | BH | 22 |
|
|
292
|
-
| 8 | Belarus | BY | 28 |
|
|
293
|
-
| 9 | Belgium | BE | 16 |
|
|
294
|
-
| 10 | Benin | BJ | 28 |
|
|
295
|
-
| 11 | Bosnia and Herzegovina | BA | 20 |
|
|
296
|
-
| 12 | Brazil | BR | 29 |
|
|
297
|
-
| 13 | Bulgaria | BG | 22 |
|
|
298
|
-
| 14 | Burundi | BI | 27 |
|
|
299
|
-
| 15 | Burkina Faso | BF | 28 |
|
|
300
|
-
| 16 | Cameroon | CM | 27 |
|
|
301
|
-
| 17 | Cape Verde | CV | 25 |
|
|
302
|
-
| 18 | Central African Republic | CF | 27 |
|
|
303
|
-
| 19 | Chad | TD | 27 |
|
|
304
|
-
| 20 | Comoros | KM | 27 |
|
|
305
|
-
| 21 | Congo | CG | 27 |
|
|
306
|
-
| 22 | Costa Rica | CR | 22 |
|
|
307
|
-
| 23 | Croatia | HR | 21 |
|
|
308
|
-
| 24 | Cyprus | CY | 28 |
|
|
309
|
-
| 25 | Czech Republic | CZ | 24 |
|
|
310
|
-
| 26 | Denmark | DK | 18 |
|
|
311
|
-
| 27 | Djibouti | DJ | 27 |
|
|
312
|
-
| 28 | Dominican Republic | DO | 28 |
|
|
313
|
-
| 29 | Egypt | EG | 29 |
|
|
314
|
-
| 30 | El Salvador | SV | 28 |
|
|
315
|
-
| 32 | Equatorial Guinea | GQ | 27 |
|
|
316
|
-
| 33 | Estonia | EE | 20 |
|
|
317
|
-
| 34 | Falkland Islands | FK | 18 |
|
|
318
|
-
| 35 | Faroe Islands | FO | 18 |
|
|
319
|
-
| 36 | Finland | FI | 18 |
|
|
320
|
-
| 37 | France | FR | 27 |
|
|
321
|
-
| 38 | Gabon | GA | 27 |
|
|
322
|
-
| 39 | Georgia | GE | 22 |
|
|
323
|
-
| 40 | Germany | DE | 22 |
|
|
324
|
-
| 41 | Gibraltar | GI | 23 |
|
|
325
|
-
| 42 | Greece | GR | 27 |
|
|
326
|
-
| 43 | Greenland | GL | 18 |
|
|
327
|
-
| 44 | Guatemala | GT | 28 |
|
|
328
|
-
| 45 | Guinea-Bissau | GW | 25 |
|
|
329
|
-
| 46 | Vatican | VA | 22 |
|
|
330
|
-
| 47 | Honduras | HN | 28 |
|
|
331
|
-
| 48 | Hungary | HU | 28 |
|
|
332
|
-
| 49 | Iceland | IS | 26 |
|
|
333
|
-
| 50 | Iran | IR | 26 |
|
|
334
|
-
| 51 | Iraq | IQ | 23 |
|
|
335
|
-
| 52 | Ireland | IE | 22 |
|
|
336
|
-
| 53 | Israel | IL | 23 |
|
|
337
|
-
| 54 | Italy | IT | 27 |
|
|
338
|
-
| 55 | Ivory Coast | CI | 28 |
|
|
339
|
-
| 56 | Jordan | JO | 30 |
|
|
340
|
-
| 57 | Kazakhstan | KZ | 20 |
|
|
341
|
-
| 58 | Kosovo | XK | 20 |
|
|
342
|
-
| 59 | Kuwait | KW | 30 |
|
|
343
|
-
| 60 | Latvia | LV | 21 |
|
|
344
|
-
| 61 | Lebanon | LB | 28 |
|
|
345
|
-
| 62 | Libya | LY | 25 |
|
|
346
|
-
| 63 | Liechtenstein | LI | 21 |
|
|
347
|
-
| 64 | Lithuania | LT | 20 |
|
|
348
|
-
| 65 | Luxembourg | LU | 20 |
|
|
349
|
-
| 66 | Madagascar | MG | 27 |
|
|
350
|
-
| 67 | Mali | ML | 28 |
|
|
351
|
-
| 68 | Malta | MT | 31 |
|
|
352
|
-
| 69 | Mauritania | MR | 27 |
|
|
353
|
-
| 70 | Mauritius | MU | 30 |
|
|
354
|
-
| 71 | Moldova | MD | 24 |
|
|
355
|
-
| 72 | Monaco | MC | 27 |
|
|
356
|
-
| 73 | Mongolia | MN | 20 |
|
|
357
|
-
| 74 | Montenegro | ME | 22 |
|
|
358
|
-
| 75 | Morocco | MA | 28 |
|
|
359
|
-
| 76 | Mozambique | MZ | 25 |
|
|
360
|
-
| 77 | Netherlands | NL | 18 |
|
|
361
|
-
| 78 | Nicaragua | NI | 28 |
|
|
362
|
-
| 79 | Niger | NE | 28 |
|
|
363
|
-
| 80 | North Macedonia | MK | 19 |
|
|
364
|
-
| 81 | Norway | NO | 15 |
|
|
365
|
-
| 82 | Pakistan | PK | 24 |
|
|
366
|
-
| 83 | Palestine | PS | 29 |
|
|
367
|
-
| 84 | Poland | PL | 28 |
|
|
368
|
-
| 85 | Portugal | PT | 25 |
|
|
369
|
-
| 86 | Qatar | QA | 29 |
|
|
370
|
-
| 87 | Romania | RO | 24 |
|
|
371
|
-
| 88 | Russia | RU | 33 |
|
|
372
|
-
| 89 | Saint Lucia | LC | 32 |
|
|
373
|
-
| 90 | San Marino | SM | 27 |
|
|
374
|
-
| 91 | Sao Tome and Principe | ST | 25 |
|
|
375
|
-
| 92 | Saudi Arabia | SA | 24 |
|
|
376
|
-
| 93 | Senegal | SN | 28 |
|
|
377
|
-
| 94 | Serbia | RS | 22 |
|
|
378
|
-
| 95 | Seychelles | SC | 31 |
|
|
379
|
-
| 96 | Slovak Republic | SK | 24 |
|
|
380
|
-
| 97 | Slovenia | SI | 19 |
|
|
381
|
-
| 98 | Somalia | SO | 23 |
|
|
382
|
-
| 99 | Spain | ES | 24 |
|
|
383
|
-
| 100 | Sudan | SD | 18 |
|
|
384
|
-
| 101 | Sultanate of Oman | OM | 23 |
|
|
385
|
-
| 102 | Sweden | SE | 24 |
|
|
386
|
-
| 103 | Switzerland | CH | 21 |
|
|
387
|
-
| 104 | Timor-Leste | TL | 23 |
|
|
388
|
-
| 105 | Togo | TG | 28 |
|
|
389
|
-
| 106 | Tunisia | TN | 24 |
|
|
390
|
-
| 107 | Turkey | TR | 26 |
|
|
391
|
-
| 108 | Ukraine | UA | 29 |
|
|
392
|
-
| 109 | United Arab Emirates | AE | 23 |
|
|
393
|
-
| 110 | United Kingdom | GB | 22 |
|
|
394
|
-
| 111 | Virgin Islands, British | VG | 24 |
|
|
395
|
-
| 112 | Yemen | YE | 30 |
|
|
396
|
-
|
|
397
|
-
</details>
|
|
398
|
-
|
|
399
|
-
###
|
|
400
|
-
|
|
401
|
-
# Development
|
|
402
|
-
|
|
403
|
-
## Install dependencies
|
|
404
|
-
|
|
405
|
-
```bash
|
|
406
|
-
npm i
|
|
407
|
-
```
|
|
408
|
-
|
|
409
|
-
## Test
|
|
410
|
-
|
|
411
|
-
```bash
|
|
412
|
-
npm run test
|
|
413
|
-
```
|
|
414
|
-
|
|
415
|
-
## Build
|
|
416
|
-
|
|
417
|
-
```bash
|
|
418
|
-
npx tsc
|
|
419
|
-
```
|
|
420
|
-
|
|
421
|
-
# Changelog
|
|
422
|
-
|
|
423
|
-
## v 1.2.2
|
|
424
|
-
|
|
425
|
-
- Added Support for Yemen
|
|
426
|
-
- Updated validate function to not return countryUnsupported error if input is for example 'YE' country is supported but length is invalid so instead codeLengthInvalid error will be returned
|
|
427
|
-
- Updated tests and docs
|
|
428
|
-
|
|
429
|
-
## v 1.2.1
|
|
430
|
-
|
|
431
|
-
- Updated Burundi (BI) length 16 -> 27
|
|
432
|
-
- Updated Nicaragua (NI) length 32 -> 28
|
|
433
|
-
|
|
434
|
-
## v 1.2.0
|
|
435
|
-
|
|
436
|
-
- Updated documentation
|
|
437
|
-
|
|
438
|
-
## v 1.1.9
|
|
439
|
-
|
|
440
|
-
- Added support for Sultanate of Oman
|
|
441
|
-
|
|
442
|
-
## v 1.1.8
|
|
443
|
-
|
|
444
|
-
- Added support for Falkland Islands
|
|
445
|
-
|
|
446
|
-
## v 1.1.7
|
|
447
|
-
|
|
448
|
-
- Added support for Djibouti and Somalia
|
|
449
|
-
|
|
450
|
-
## v 1.1.6
|
|
451
|
-
|
|
452
|
-
- Updated error display logic
|
|
453
|
-
- Value can be passed directly as a string or part of the object.
|
|
454
|
-
- If value is passed as a part of object same logic as for form validation is applied:
|
|
455
|
-
- If IBAN is valid as result of validation **null** is returned.
|
|
456
|
-
- If IBAN is invalid and some of the checks fail IBANValidationResult object is returned containing more info about error.
|
|
457
|
-
- If value is passed as a string:
|
|
458
|
-
- For valid and invalid IBAN IBANValidationResult object is returned.
|
|
459
|
-
- Return null for valid form field to fix issue with disabling | enabling buttons
|
|
460
|
-
- Thnx to @pramodEE for reporting the issue
|
|
461
|
-
|
|
462
|
-
## v 1.1.5
|
|
463
|
-
|
|
464
|
-
Added additional pattern validation
|
|
465
|
-
Added more tests to improve test coverage
|
|
466
|
-
Added support for new countries: Algeria, Angola, Benin, Burkina Faso, Burundi, Cameroon, Cape Verde, Central African Republic, Chad, Comoros, Congo, Equatorial Guinea, Gabon, Guinea-Bissau, Honduras, Iran, Ivory Coast, Madagascar, Mali, Mongolia, Morocco, Mozambique, Nicaragua, Niger, Russia, Senegal, Togo
|
|
467
|
-
|
|
468
|
-
## v 1.1.4
|
|
469
|
-
|
|
470
|
-
Avoid Angular warnings for old CommonJS module usage (see https://angular.io/guide/build#configuring-commonjs-dependencies)
|
|
471
|
-
|
|
472
|
-
Replaced mocha and chai with JEST for tests
|
|
473
|
-
|
|
474
|
-
## v 1.1.3
|
|
475
|
-
|
|
476
|
-
Added support for new countries: Vatican, Libya, Sao Tome and Principe, Sudan
|
|
477
|
-
Updated length for LC Saint Lucia from 30 to 32
|
|
478
|
-
|
|
479
|
-
Added Tests
|
|
480
|
-
Added Mocha and Chai for testing
|
|
481
|
-
|
|
482
|
-
## v 1.1.2
|
|
483
|
-
|
|
484
|
-
Updated length for CR to 22 - @freddy36
|
|
485
|
-
|
|
486
283
|
## Read more
|
|
487
284
|
|
|
488
285
|
[IBAN Examples](https://www.iban.com/structure)
|
package/biome.jsonc
ADDED
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "https://biomejs.dev/schemas/2.2.2/schema.json",
|
|
3
|
+
|
|
4
|
+
"formatter": {
|
|
5
|
+
"enabled": true,
|
|
6
|
+
"indentStyle": "space",
|
|
7
|
+
"lineWidth": 120
|
|
8
|
+
},
|
|
9
|
+
"javascript": {
|
|
10
|
+
"formatter": {
|
|
11
|
+
"trailingCommas": "es5"
|
|
12
|
+
}
|
|
13
|
+
},
|
|
14
|
+
"json": {
|
|
15
|
+
"formatter": {
|
|
16
|
+
"trailingCommas": "none"
|
|
17
|
+
}
|
|
18
|
+
},
|
|
19
|
+
"linter": {
|
|
20
|
+
"enabled": true,
|
|
21
|
+
"rules": {
|
|
22
|
+
"recommended": true,
|
|
23
|
+
"suspicious": {
|
|
24
|
+
"noExplicitAny": "off", // `any` is amazing
|
|
25
|
+
"noUnsafeDeclarationMerging": "off",
|
|
26
|
+
"noMisleadingInstantiator": "off",
|
|
27
|
+
"noEmptyInterface": "off",
|
|
28
|
+
"noConfusingVoidType": "off",
|
|
29
|
+
"noThenProperty": "off"
|
|
30
|
+
},
|
|
31
|
+
"style": {
|
|
32
|
+
"noUnusedTemplateLiteral": "off", // why is this even a best practice?
|
|
33
|
+
"noParameterAssign": "off", // required for performant coercion in _parse
|
|
34
|
+
"noNonNullAssertion": "off",
|
|
35
|
+
"useTemplate": "off",
|
|
36
|
+
"noUselessElse": "off"
|
|
37
|
+
},
|
|
38
|
+
"correctness": {
|
|
39
|
+
"noUnusedImports": {
|
|
40
|
+
"level": "error",
|
|
41
|
+
"fix": "none"
|
|
42
|
+
},
|
|
43
|
+
"noUnusedVariables": {
|
|
44
|
+
"level": "warn",
|
|
45
|
+
"fix": "none"
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"complexity": {
|
|
49
|
+
"noUselessConstructor": "off",
|
|
50
|
+
"noBannedTypes": "off",
|
|
51
|
+
"useArrowFunction": "off",
|
|
52
|
+
"useLiteralKeys": {
|
|
53
|
+
"fix": "unsafe",
|
|
54
|
+
"level": "error"
|
|
55
|
+
}
|
|
56
|
+
},
|
|
57
|
+
"performance": {
|
|
58
|
+
"noDelete": "off"
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
},
|
|
62
|
+
"files": {
|
|
63
|
+
"includes": [
|
|
64
|
+
"**/*.ts",
|
|
65
|
+
"**/*.mts",
|
|
66
|
+
"**/*.cts",
|
|
67
|
+
"!**/*.js",
|
|
68
|
+
"!**/*.mjs",
|
|
69
|
+
"!**/*.cjs",
|
|
70
|
+
"!**/*.d.ts",
|
|
71
|
+
"!**/*.d.cts",
|
|
72
|
+
"!**/*.d.mts",
|
|
73
|
+
"!**/lib",
|
|
74
|
+
"!**/coverage",
|
|
75
|
+
"!**/dist",
|
|
76
|
+
"!**/.tshy",
|
|
77
|
+
"!**/.tshy-build",
|
|
78
|
+
"!**/experiments",
|
|
79
|
+
"!**/node_modules",
|
|
80
|
+
"!**/.next",
|
|
81
|
+
"!**/packages/bench",
|
|
82
|
+
"!**/packages/treeshake",
|
|
83
|
+
"!**/.source"
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
}
|
package/dist/LICENCE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2025 Samir Kahvedzic
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|