Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions DOCS.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,7 @@ then it is checked if expiration date is later than release date. Date in format
* [.isLanNumberValidator](#module_General Validators.isLanNumberValidator) ⇒ <code>boolean</code>
* [.isRoutingCodeValidator](#module_General Validators.isRoutingCodeValidator) ⇒ <code>boolean</code>
* [.isTaxNumberValidator](#module_General Validators.isTaxNumberValidator) ⇒ <code>boolean</code>
* [.isCnapsCodeValidator](#module_General Validators.isCnapsCodeValidator) ⇒ <code>boolean</code>
* [.isSwiftValidator](#module_General Validators.isSwiftValidator) ⇒ <code>boolean</code>
* [.isSwiftCountryValidator](#module_General Validators.isSwiftCountryValidator) ⇒ <code>boolean</code>
* [.isIdNumberValidator](#module_General Validators.isIdNumberValidator) ⇒ <code>boolean</code>
Expand Down Expand Up @@ -424,6 +425,17 @@ then it is checked if expiration date is later than release date. Date in format
| [country] | <code>string</code> | <p>optional country to check.</p> |
| [isCompany] | <code>boolean</code> | <p>optional isCompany to check.</p> |

<a name="module_General Validators.isCnapsCodeValidator"></a>

### General Validators.isCnapsCodeValidator ⇒ <code>boolean</code>
<p>Checks if value is valid cnaps code</p>

**Kind**: static property of [<code>General Validators</code>](#module_General Validators)

| Param | Type | Description |
| --- | --- | --- |
| value | <code>string</code> | <p>value to check.</p> |

<a name="module_General Validators.isSwiftValidator"></a>

### General Validators.isSwiftValidator ⇒ <code>boolean</code>
Expand Down
7 changes: 7 additions & 0 deletions lib/main/general-validators.ts
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,13 @@ export const isTaxNumberValidator = (value: string, country?: string, isCompany?
* @returns {boolean}
*/

export const isCnapsCodeValidator = (value: string): boolean => !!value.match(/^\d{12}$/)
/**
* Checks if value is valid cnaps code
* @param {string} value - value to check.
* @returns {boolean}
*/

export const isSwiftValidator = (value: string): boolean => !!value.match(/^[A-Z]{6}[A-Z0-9]{2}([A-Z0-9]{3})?$/i)
/**
* Checks if value is valid swift number
Expand Down
Loading