11# Validators
22
33## isValidNIF(nif: string)
4- Validates a portuguese fiscal number
54
5+ Validates a portuguese fiscal number
66
77#### Arguments
8- *** nif (string)*** : The fiscal number to be checked as string.
98
9+ ** _ nif (string)_ ** : The fiscal number to be checked as string.
1010
1111#### Returns
12- *** (boolean)*** : True if valid and False if invalid.
1312
13+ ** _ (boolean)_ ** : True if valid and False if invalid.
1414
1515#### Example
1616
@@ -23,16 +23,16 @@ console.log(isNIFValid)
2323```
2424
2525## isValidPostalCode(postalCode: string)
26- Validates a portuguese postal-code
2726
27+ Validates a portuguese postal-code
2828
2929#### Arguments
30- *** postalCode (string)*** : The postal code to be checked as string.
3130
31+ ** _ postalCode (string)_ ** : The postal code to be checked as string.
3232
3333#### Returns
34- *** (boolean)*** : True if valid and False if invalid.
3534
35+ ** _ (boolean)_ ** : True if valid and False if invalid.
3636
3737#### Example
3838
@@ -43,17 +43,18 @@ const isCodeValid = isValidPostalCode('3865-134')
4343console .log (isCodeValid)
4444// => true
4545```
46+
4647## isValidMobileNumber(mobileNumber: string)
47- Validates a portuguese mobile number
4848
49+ Validates a portuguese mobile number
4950
5051#### Arguments
51- *** mobileNumber (string)*** : The mobile number to be checked as string.
5252
53+ ** _ mobileNumber (string)_ ** : The mobile number to be checked as string.
5354
5455#### Returns
55- *** (boolean)*** : True if valid and False if invalid.
5656
57+ ** _ (boolean)_ ** : True if valid and False if invalid.
5758
5859#### Example
5960
@@ -66,16 +67,16 @@ console.log(isNumberValid)
6667```
6768
6869## isValidCCNumber(citizenCardNumber: string)
69- Validates a portuguese citizen card number
7070
71+ Validates a portuguese citizen card number
7172
7273#### Arguments
73- *** citizenCardNumber (string)*** : The citizen card number to be checked as string.
7474
75+ ** _ citizenCardNumber (string)_ ** : The citizen card number to be checked as string.
7576
7677#### Returns
77- *** (boolean)*** : True if valid and False if invalid.
7878
79+ ** _ (boolean)_ ** : True if valid and False if invalid.
7980
8081#### Example
8182
@@ -88,16 +89,16 @@ console.log(isCCValid)
8889```
8990
9091## isValidLicensePlate(plateNumber: string)
91- Validates a portuguese license plate number
9292
93+ Validates a portuguese license plate number
9394
9495#### Arguments
95- *** plateNumber (string)*** : The license plate number checked as string.
9696
97+ ** _ plateNumber (string)_ ** : The license plate number checked as string.
9798
9899#### Returns
99- *** (boolean)*** : True if valid and False if invalid.
100100
101+ ** _ (boolean)_ ** : True if valid and False if invalid.
101102
102103#### Example
103104
@@ -107,4 +108,29 @@ const isLicensePlateValid = isValidLicensePlate('00-AA-00')
107108
108109console .log (isLicensePlateValid)
109110// => true
110- ```
111+ ```
112+
113+ ## isValidCPECUI(cpe: string)
114+
115+ Validates CPE and CUI
116+
117+ * CPE - Código de ponto de entrega
118+ * CUI - Código universal da instalação
119+
120+ #### Arguments
121+
122+ ** _ cpe (string)_ ** : the CPE or CUI.
123+
124+ #### Returns
125+
126+ ** _ (boolean)_ ** : True if valid and False if invalid.
127+
128+ #### Example
129+
130+ ``` js
131+ import isValidCPECUI from ' portuguese-utils/validators/isValidCPECUI'
132+ const isValid = isValidCPECUI (' PT 0014 483920194837 DW' )
133+
134+ console .log (isValid)
135+ // => true
136+ ```
0 commit comments