@arkyn/shared 1.2.4 → 1.3.0
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/dist/currencyFormat.d.ts +1 -1
- package/dist/currencyFormat.js +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/regex.d.ts +10 -0
- package/dist/regex.d.ts.map +1 -0
- package/dist/regex.js +8 -0
- package/package.json +1 -1
- package/src/currencyFormat.ts +1 -1
- package/src/index.ts +1 -0
- package/src/regex.ts +17 -0
package/dist/currencyFormat.d.ts
CHANGED
package/dist/currencyFormat.js
CHANGED
|
@@ -3,6 +3,6 @@ function currencyFormat(value) {
|
|
|
3
3
|
style: "currency",
|
|
4
4
|
currency: "BRL",
|
|
5
5
|
}).format(value);
|
|
6
|
-
return { value: format,
|
|
6
|
+
return { value: format, valueWithoutPrefix: format.replace("R$", "").trim() };
|
|
7
7
|
}
|
|
8
8
|
export { currencyFormat };
|
package/dist/index.d.ts
CHANGED
|
@@ -2,4 +2,5 @@ export { calculateCardInstallment } from "./calculateCardInstallment";
|
|
|
2
2
|
export { generateColorByString } from "./generateColorByString";
|
|
3
3
|
export { generateSlug } from "./generateSlug";
|
|
4
4
|
export { currencyFormat } from "./currencyFormat";
|
|
5
|
+
export { regex } from "./regex";
|
|
5
6
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,wBAAwB,EAAE,MAAM,4BAA4B,CAAC;AACtE,OAAO,EAAE,qBAAqB,EAAE,MAAM,yBAAyB,CAAC;AAChE,OAAO,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAC9C,OAAO,EAAE,cAAc,EAAE,MAAM,kBAAkB,CAAC;AAClD,OAAO,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC"}
|
package/dist/index.js
CHANGED
package/dist/regex.d.ts
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"regex.d.ts","sourceRoot":"","sources":["../src/regex.ts"],"names":[],"mappings":"AAgBA,eAAO,MAAM,KAAK;;;;;;;;CAA+C,CAAC"}
|
package/dist/regex.js
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
const CEP = /(^[0-9]{5})-?([0-9]{3}$)/;
|
|
2
|
+
const CNPJ = /(^\d{2}\.\d{3}\.\d{3}\/\d{4}\-\d{2}$)/;
|
|
3
|
+
const CPF = /(^\d{3}\.\d{3}\.\d{3}\-\d{2}$)/;
|
|
4
|
+
const PASSWORD = /(?=^.{8,}$)((?=.*\w)(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[|!"$%&\/\(\)\?\^\'\\\+\-\*]))^.*/;
|
|
5
|
+
const PHONE = /([0-9]{2})?(\s|-)?(9?[0-9]{4})-?([0-9]{4}$)/;
|
|
6
|
+
const RG = /(^\d{1,2}).?(\d{3}).?(\d{3})-?(\d{1}|X|x$)/;
|
|
7
|
+
const URL = /^(((https?|ftp):\/\/)?([\w\-\.])+(\.)([\w]){2,4}([\w\/+=%&_\.~?\-]*))*$/;
|
|
8
|
+
export const regex = { URL, RG, PHONE, PASSWORD, CPF, CNPJ, CEP };
|
package/package.json
CHANGED
package/src/currencyFormat.ts
CHANGED
|
@@ -4,7 +4,7 @@ function currencyFormat(value: number) {
|
|
|
4
4
|
currency: "BRL",
|
|
5
5
|
}).format(value);
|
|
6
6
|
|
|
7
|
-
return { value: format,
|
|
7
|
+
return { value: format, valueWithoutPrefix: format.replace("R$", "").trim() };
|
|
8
8
|
}
|
|
9
9
|
|
|
10
10
|
export { currencyFormat };
|
package/src/index.ts
CHANGED
package/src/regex.ts
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
const CEP = /(^[0-9]{5})-?([0-9]{3}$)/;
|
|
2
|
+
|
|
3
|
+
const CNPJ = /(^\d{2}\.\d{3}\.\d{3}\/\d{4}\-\d{2}$)/;
|
|
4
|
+
|
|
5
|
+
const CPF = /(^\d{3}\.\d{3}\.\d{3}\-\d{2}$)/;
|
|
6
|
+
|
|
7
|
+
const PASSWORD =
|
|
8
|
+
/(?=^.{8,}$)((?=.*\w)(?=.*[A-Z])(?=.*[a-z])(?=.*[0-9])(?=.*[|!"$%&\/\(\)\?\^\'\\\+\-\*]))^.*/;
|
|
9
|
+
|
|
10
|
+
const PHONE = /([0-9]{2})?(\s|-)?(9?[0-9]{4})-?([0-9]{4}$)/;
|
|
11
|
+
|
|
12
|
+
const RG = /(^\d{1,2}).?(\d{3}).?(\d{3})-?(\d{1}|X|x$)/;
|
|
13
|
+
|
|
14
|
+
const URL =
|
|
15
|
+
/^(((https?|ftp):\/\/)?([\w\-\.])+(\.)([\w]){2,4}([\w\/+=%&_\.~?\-]*))*$/;
|
|
16
|
+
|
|
17
|
+
export const regex = { URL, RG, PHONE, PASSWORD, CPF, CNPJ, CEP };
|