@zydon/common 2.3.57 → 2.3.58

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.
@@ -0,0 +1,3 @@
1
+ var u=e=>{if(!e||(e=e?.replace(/[^\d]+/g,""),e.length!==11||e==="00000000000"||e==="11111111111"||e==="22222222222"||e==="33333333333"||e==="44444444444"||e==="55555555555"||e==="66666666666"||e==="77777777777"||e==="88888888888"||e==="99999999999"))return !1;let t=0;for(let s=0;s<9;s++)t+=parseInt(e.charAt(s))*(10-s);let r=11-t%11;if((r===10||r===11)&&(r=0),r!==parseInt(e.charAt(9)))return !1;t=0;for(let s=0;s<10;s++)t+=parseInt(e.charAt(s))*(11-s);return r=11-t%11,(r===10||r===11)&&(r=0),r===parseInt(e.charAt(10))},h=e=>{if(!e||(e=e.replace(/[^\d]+/g,""),e.length!==14)||e==="00000000000000"||e==="11111111111111"||e==="22222222222222"||e==="33333333333333"||e==="44444444444444"||e==="55555555555555"||e==="66666666666666"||e==="77777777777777"||e==="88888888888888"||e==="99999999999999")return !1;let t=e.length-2,r=e.substring(0,t),s=e.substring(t),a=0,i=t-7;for(let n=t;n>=1;n--)a+=parseInt(r.charAt(t-n))*i--,i<2&&(i=9);let l=a%11<2?0:11-a%11;if(l!==parseInt(s.charAt(0)))return !1;t+=1,r=e.substring(0,t),a=0,i=t-7;for(let n=t;n>=1;n--)a+=parseInt(r.charAt(t-n))*i--,i<2&&(i=9);return l=a%11<2?0:11-a%11,l===parseInt(s.charAt(1))},f=(e="")=>e?!!e.toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/):!1,g=(e="",t=[8,20],r=!1,s=!1,a=!1)=>{let i=e.length>=t[0]&&e.length<=t[1],l=!a||/[A-Z]/.test(e),n=!s||/[!@#$%^&*(),.?":{}|<>]/.test(e),o=!r||/\d/.test(e);return {isLengthValid:i,hasUpperCaseChar:l,hasSpecialCharacter:n,hasNumberChar:o}},d=e=>e&&e.trim().length>0?!0:"N\xE3o pode ser apenas espa\xE7os em branco",A=e=>{if(e&&e.length!==8)return "CEP inv\xE1lido"};
2
+
3
+ export { u as a, h as b, f as c, g as d, d as e, A as f };
@@ -1,4 +1,4 @@
1
- import { d } from '../../chunk-CQDKXUUX.js';
1
+ import { d } from '../../chunk-KOELUX3V.js';
2
2
  import { a as a$1 } from '../../chunk-V3QQVP43.js';
3
3
  import '../../chunk-XTDKAE3Z.js';
4
4
  import a from '@mui/material/Typography';
@@ -1,5 +1,5 @@
1
1
  import { a } from '../../../chunk-VTHBHXM2.js';
2
- import { d } from '../../../chunk-CQDKXUUX.js';
2
+ import { d } from '../../../chunk-KOELUX3V.js';
3
3
  import { a as a$1 } from '../../../chunk-V3QQVP43.js';
4
4
  import '../../../chunk-XTDKAE3Z.js';
5
5
  import { useState } from 'react';
@@ -7,5 +7,7 @@ declare const validatePassword: (password?: string, passwordSize?: number[], num
7
7
  hasSpecialCharacter: boolean;
8
8
  hasNumberChar: boolean;
9
9
  };
10
+ declare const notOnlySpaces: (value: string) => true | "Não pode ser apenas espaços em branco";
11
+ declare const validNumberCep: (v: string | undefined) => "CEP inválido" | undefined;
10
12
 
11
- export { cnpjIsValid, cpfIsValid, emailIsValid, validatePassword };
13
+ export { cnpjIsValid, cpfIsValid, emailIsValid, notOnlySpaces, validNumberCep, validatePassword };
@@ -1 +1 @@
1
- export { b as cnpjIsValid, a as cpfIsValid, c as emailIsValid, d as validatePassword } from '../chunk-CQDKXUUX.js';
1
+ export { b as cnpjIsValid, a as cpfIsValid, c as emailIsValid, e as notOnlySpaces, f as validNumberCep, d as validatePassword } from '../chunk-KOELUX3V.js';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@zydon/common",
3
- "version": "2.3.57",
3
+ "version": "2.3.58",
4
4
  "license": "MIT",
5
5
  "type": "module",
6
6
  "module": "./dist/index.js",
@@ -1,3 +0,0 @@
1
- var h=t=>{if(!t||(t=t?.replace(/[^\d]+/g,""),t.length!==11||t==="00000000000"||t==="11111111111"||t==="22222222222"||t==="33333333333"||t==="44444444444"||t==="55555555555"||t==="66666666666"||t==="77777777777"||t==="88888888888"||t==="99999999999"))return !1;let e=0;for(let s=0;s<9;s++)e+=parseInt(t.charAt(s))*(10-s);let r=11-e%11;if((r===10||r===11)&&(r=0),r!==parseInt(t.charAt(9)))return !1;e=0;for(let s=0;s<10;s++)e+=parseInt(t.charAt(s))*(11-s);return r=11-e%11,(r===10||r===11)&&(r=0),r===parseInt(t.charAt(10))},o=t=>{if(!t||(t=t.replace(/[^\d]+/g,""),t.length!==14)||t==="00000000000000"||t==="11111111111111"||t==="22222222222222"||t==="33333333333333"||t==="44444444444444"||t==="55555555555555"||t==="66666666666666"||t==="77777777777777"||t==="88888888888888"||t==="99999999999999")return !1;let e=t.length-2,r=t.substring(0,e),s=t.substring(e),a=0,l=e-7;for(let i=e;i>=1;i--)a+=parseInt(r.charAt(e-i))*l--,l<2&&(l=9);let n=a%11<2?0:11-a%11;if(n!==parseInt(s.charAt(0)))return !1;e+=1,r=t.substring(0,e),a=0,l=e-7;for(let i=e;i>=1;i--)a+=parseInt(r.charAt(e-i))*l--,l<2&&(l=9);return n=a%11<2?0:11-a%11,n===parseInt(s.charAt(1))},f=(t="")=>t?!!t.toLowerCase().match(/^(([^<>()[\]\\.,;:\s@"]+(\.[^<>()[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/):!1,g=(t="",e=[8,20],r=!1,s=!1,a=!1)=>{let l=t.length>=e[0]&&t.length<=e[1],n=!a||/[A-Z]/.test(t),i=!s||/[!@#$%^&*(),.?":{}|<>]/.test(t),u=!r||/\d/.test(t);return {isLengthValid:l,hasUpperCaseChar:n,hasSpecialCharacter:i,hasNumberChar:u}};
2
-
3
- export { h as a, o as b, f as c, g as d };