monkey-front-core 0.0.576 → 0.0.578
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/esm2020/lib/core/utils/utils.mjs +6 -1
- package/esm2020/lib/core/utils/validators.mjs +2 -2
- package/fesm2015/monkey-front-core.mjs +6 -1
- package/fesm2015/monkey-front-core.mjs.map +1 -1
- package/fesm2020/monkey-front-core.mjs +6 -1
- package/fesm2020/monkey-front-core.mjs.map +1 -1
- package/lib/core/utils/utils.d.ts +1 -1
- package/monkey-front-core-0.0.578.tgz +0 -0
- package/package.json +1 -1
- package/monkey-front-core-0.0.576.tgz +0 -0
|
@@ -157,6 +157,8 @@ class MonkeyEcxUtils {
|
|
|
157
157
|
return 'RUT';
|
|
158
158
|
if (country === 'mx')
|
|
159
159
|
return 'RFC';
|
|
160
|
+
if (country === 'us')
|
|
161
|
+
return 'EIN';
|
|
160
162
|
return doc.length <= 11 ? 'CPF' : 'CNPJ';
|
|
161
163
|
}
|
|
162
164
|
static getDocumentMask(type, country = '') {
|
|
@@ -202,6 +204,9 @@ class MonkeyEcxUtils {
|
|
|
202
204
|
formated = doc.replace(/^(\d{1,2})(\d{3})(\d{3})(\w{1})$/, '$1.$2.$3-$4');
|
|
203
205
|
return `${formated}`;
|
|
204
206
|
}
|
|
207
|
+
if (country === 'us') {
|
|
208
|
+
return doc;
|
|
209
|
+
}
|
|
205
210
|
if (doc.length === 14) {
|
|
206
211
|
formated = doc
|
|
207
212
|
.replace(/^(\d{2})(\d)/, '$1.$2')
|
|
@@ -1575,7 +1580,7 @@ function validateFullName(control) {
|
|
|
1575
1580
|
const fullName = value.split(/\s+/);
|
|
1576
1581
|
const hasShortPart = fullName.some(part => part.length < 2);
|
|
1577
1582
|
if (fullName.length < 2 || hasShortPart) {
|
|
1578
|
-
return {
|
|
1583
|
+
return { fullName: true };
|
|
1579
1584
|
}
|
|
1580
1585
|
return null;
|
|
1581
1586
|
}
|