regex-belt 0.1.7 → 0.1.8

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/README.md CHANGED
@@ -22,7 +22,7 @@ countries.br.cpf.test('123.456.789-09'); // true
22
22
 
23
23
  ### Countries / BR
24
24
 
25
- [**`cpf`**](./src/regexen/countries/br/cpf.ts) — `✅ '123.456.789-09'` — Matches a Brazilian CPF number in the format XXX.XXX.XXX-XX
25
+ [**`cpf`**](./src/regexen/countries/br/cpf.ts) — `✅ '123.456.789-09'` — Matches a Brazilian CPF number in the format XXX.XXX.XXX-XX *(Enforces beginning and end of string)*
26
26
 
27
27
  ```regex
28
28
  /^\d{3}\.\d{3}\.\d{3}-\d{2}$/
@@ -39,7 +39,7 @@ countries.br.cpf.test('123.456.789-09'); // true
39
39
 
40
40
  ### Datetime
41
41
 
42
- [**`dashedDateLoose`**](./src/regexen/datetime/dashed-date-loose.ts) — `✅ '2022-12-31'` — Matches a date in the format YYYY-MM-DD Valid digits are 0000 to 9999 for year, 01 to 12 for month and 01 to 31 for day
42
+ [**`dashedDateLoose`**](./src/regexen/datetime/dashed-date-loose.ts) — `✅ '2022-12-31'` — Matches a date in the format YYYY-MM-DD Valid digits are 0000 to 9999 for year, 01 to 12 for month and 01 to 31 for day *(Does not enforce beginning and end of string)*
43
43
 
44
44
  ```regex
45
45
  /([0-9]{4}-([0][1-9]|[1][0-2])-([1-2][0-9]|[0][1-9]|[3][0-1]))/
@@ -57,7 +57,7 @@ countries.br.cpf.test('123.456.789-09'); // true
57
57
 
58
58
  ---
59
59
 
60
- [**`dashedDate`**](./src/regexen/datetime/dashed-date.ts) — `✅ '2022-12-31'` — Matches a date in the format YYYY-MM-DD Valid digits are 0000 to 9999 for year, 01 to 12 for month and 01 to 31 for day.
60
+ [**`dashedDate`**](./src/regexen/datetime/dashed-date.ts) — `✅ '2022-12-31'` — Matches a date in the format YYYY-MM-DD Valid digits are 0000 to 9999 for year, 01 to 12 for month and 01 to 31 for day. *(Enforces beginning and end of string)*
61
61
 
62
62
  ```regex
63
63
  /^([0-9]{4}-([0][1-9]|[1][0-2])-([1-2][0-9]|[0][1-9]|[3][0-1]))$/
package/dist/index.cjs CHANGED
@@ -16,8 +16,8 @@ var __exportAll = (all, no_symbols) => {
16
16
  * Matches a Brazilian CPF number in the format XXX.XXX.XXX-XX
17
17
  *
18
18
  * ___Enforces beginning and end of string___
19
- * @example '123.456.789-09' (matches)
20
- * @example '12345678909' (does not match)
19
+ * @example '123.456.789-09'
20
+ * @example '12345678909'
21
21
  */
22
22
  const cpf = /^\d{3}\.\d{3}\.\d{3}-\d{2}$/;
23
23
  //#endregion
@@ -33,9 +33,9 @@ var _index_exports = /* @__PURE__ */ __exportAll({ br: () => _index_exports$2 })
33
33
  * Valid digits are 0000 to 9999 for year, 01 to 12 for month and 01 to 31 for day.
34
34
  *
35
35
  * ___Enforces beginning and end of string___
36
- * @example '2022-12-31' (matches)
37
- * @example '2022-12-31T23:59:59.999Z' (does not match)
38
- * @example '9992022-12-31' (does not match)
36
+ * @example '2022-12-31'
37
+ * @example '2022-12-31T23:59:59.999Z'
38
+ * @example '9992022-12-31'
39
39
  */
40
40
  const dashedDate = /^([0-9]{4}-([0][1-9]|[1][0-2])-([1-2][0-9]|[0][1-9]|[3][0-1]))$/;
41
41
  //#endregion
@@ -45,17 +45,17 @@ const dashedDate = /^([0-9]{4}-([0][1-9]|[1][0-2])-([1-2][0-9]|[0][1-9]|[3][0-1]
45
45
  * Valid digits are 0000 to 9999 for year, 01 to 12 for month and 01 to 31 for day
46
46
  *
47
47
  * ___Does not enforce beginning and end of string___
48
- * @example '2022-12-31' (matches)
49
- * @example '2022-12-31T23:59:59.999Z' (matches)
50
- * @example '9992022-12-31' (matches)
48
+ * @example '2022-12-31'
49
+ * @example '2022-12-31T23:59:59.999Z'
50
+ * @example '9992022-12-31'
51
51
  */
52
52
  const dashedDateLoose = /([0-9]{4}-([0][1-9]|[1][0-2])-([1-2][0-9]|[0][1-9]|[3][0-1]))/;
53
53
  //#endregion
54
54
  //#region src/regexen/datetime/iso-utc.ts
55
55
  /**
56
56
  * Regex that matches a UTC ISO String Date in format YYYY-MM-DDTHH:mm:ss.sssZ
57
- * @example 2022-12-31T23:59:59.999Z (with milliseconds)
58
- * @example 2022-12-31T23:59:59Z (without milliseconds)
57
+ * @example 2022-12-31T23:59:59.999Z
58
+ * @example 2022-12-31T23:59:59Z
59
59
  */
60
60
  const isoUtc = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$/;
61
61
  //#endregion
package/dist/index.d.cts CHANGED
@@ -4,8 +4,8 @@
4
4
  * Matches a Brazilian CPF number in the format XXX.XXX.XXX-XX
5
5
  *
6
6
  * ___Enforces beginning and end of string___
7
- * @example '123.456.789-09' (matches)
8
- * @example '12345678909' (does not match)
7
+ * @example '123.456.789-09'
8
+ * @example '12345678909'
9
9
  */
10
10
  declare const cpf: RegExp;
11
11
  declare namespace _index_d_exports$2 {
@@ -21,9 +21,9 @@ declare namespace _index_d_exports {
21
21
  * Valid digits are 0000 to 9999 for year, 01 to 12 for month and 01 to 31 for day.
22
22
  *
23
23
  * ___Enforces beginning and end of string___
24
- * @example '2022-12-31' (matches)
25
- * @example '2022-12-31T23:59:59.999Z' (does not match)
26
- * @example '9992022-12-31' (does not match)
24
+ * @example '2022-12-31'
25
+ * @example '2022-12-31T23:59:59.999Z'
26
+ * @example '9992022-12-31'
27
27
  */
28
28
  declare const dashedDate: RegExp;
29
29
  //#endregion
@@ -33,17 +33,17 @@ declare const dashedDate: RegExp;
33
33
  * Valid digits are 0000 to 9999 for year, 01 to 12 for month and 01 to 31 for day
34
34
  *
35
35
  * ___Does not enforce beginning and end of string___
36
- * @example '2022-12-31' (matches)
37
- * @example '2022-12-31T23:59:59.999Z' (matches)
38
- * @example '9992022-12-31' (matches)
36
+ * @example '2022-12-31'
37
+ * @example '2022-12-31T23:59:59.999Z'
38
+ * @example '9992022-12-31'
39
39
  */
40
40
  declare const dashedDateLoose: RegExp;
41
41
  //#endregion
42
42
  //#region src/regexen/datetime/iso-utc.d.ts
43
43
  /**
44
44
  * Regex that matches a UTC ISO String Date in format YYYY-MM-DDTHH:mm:ss.sssZ
45
- * @example 2022-12-31T23:59:59.999Z (with milliseconds)
46
- * @example 2022-12-31T23:59:59Z (without milliseconds)
45
+ * @example 2022-12-31T23:59:59.999Z
46
+ * @example 2022-12-31T23:59:59Z
47
47
  */
48
48
  declare const isoUtc: RegExp;
49
49
  declare namespace _index_d_exports$1 {
package/dist/index.d.mts CHANGED
@@ -3,8 +3,8 @@
3
3
  * Matches a Brazilian CPF number in the format XXX.XXX.XXX-XX
4
4
  *
5
5
  * ___Enforces beginning and end of string___
6
- * @example '123.456.789-09' (matches)
7
- * @example '12345678909' (does not match)
6
+ * @example '123.456.789-09'
7
+ * @example '12345678909'
8
8
  */
9
9
  declare const cpf: RegExp;
10
10
  declare namespace _index_d_exports$2 {
@@ -20,9 +20,9 @@ declare namespace _index_d_exports {
20
20
  * Valid digits are 0000 to 9999 for year, 01 to 12 for month and 01 to 31 for day.
21
21
  *
22
22
  * ___Enforces beginning and end of string___
23
- * @example '2022-12-31' (matches)
24
- * @example '2022-12-31T23:59:59.999Z' (does not match)
25
- * @example '9992022-12-31' (does not match)
23
+ * @example '2022-12-31'
24
+ * @example '2022-12-31T23:59:59.999Z'
25
+ * @example '9992022-12-31'
26
26
  */
27
27
  declare const dashedDate: RegExp;
28
28
  //#endregion
@@ -32,17 +32,17 @@ declare const dashedDate: RegExp;
32
32
  * Valid digits are 0000 to 9999 for year, 01 to 12 for month and 01 to 31 for day
33
33
  *
34
34
  * ___Does not enforce beginning and end of string___
35
- * @example '2022-12-31' (matches)
36
- * @example '2022-12-31T23:59:59.999Z' (matches)
37
- * @example '9992022-12-31' (matches)
35
+ * @example '2022-12-31'
36
+ * @example '2022-12-31T23:59:59.999Z'
37
+ * @example '9992022-12-31'
38
38
  */
39
39
  declare const dashedDateLoose: RegExp;
40
40
  //#endregion
41
41
  //#region src/regexen/datetime/iso-utc.d.ts
42
42
  /**
43
43
  * Regex that matches a UTC ISO String Date in format YYYY-MM-DDTHH:mm:ss.sssZ
44
- * @example 2022-12-31T23:59:59.999Z (with milliseconds)
45
- * @example 2022-12-31T23:59:59Z (without milliseconds)
44
+ * @example 2022-12-31T23:59:59.999Z
45
+ * @example 2022-12-31T23:59:59Z
46
46
  */
47
47
  declare const isoUtc: RegExp;
48
48
  declare namespace _index_d_exports$1 {
package/dist/index.mjs CHANGED
@@ -4,8 +4,8 @@ import { t as __exportAll } from "./chunk-CfYAbeIz.mjs";
4
4
  * Matches a Brazilian CPF number in the format XXX.XXX.XXX-XX
5
5
  *
6
6
  * ___Enforces beginning and end of string___
7
- * @example '123.456.789-09' (matches)
8
- * @example '12345678909' (does not match)
7
+ * @example '123.456.789-09'
8
+ * @example '12345678909'
9
9
  */
10
10
  const cpf = /^\d{3}\.\d{3}\.\d{3}-\d{2}$/;
11
11
  //#endregion
@@ -21,9 +21,9 @@ var _index_exports = /* @__PURE__ */ __exportAll({ br: () => _index_exports$2 })
21
21
  * Valid digits are 0000 to 9999 for year, 01 to 12 for month and 01 to 31 for day.
22
22
  *
23
23
  * ___Enforces beginning and end of string___
24
- * @example '2022-12-31' (matches)
25
- * @example '2022-12-31T23:59:59.999Z' (does not match)
26
- * @example '9992022-12-31' (does not match)
24
+ * @example '2022-12-31'
25
+ * @example '2022-12-31T23:59:59.999Z'
26
+ * @example '9992022-12-31'
27
27
  */
28
28
  const dashedDate = /^([0-9]{4}-([0][1-9]|[1][0-2])-([1-2][0-9]|[0][1-9]|[3][0-1]))$/;
29
29
  //#endregion
@@ -33,17 +33,17 @@ const dashedDate = /^([0-9]{4}-([0][1-9]|[1][0-2])-([1-2][0-9]|[0][1-9]|[3][0-1]
33
33
  * Valid digits are 0000 to 9999 for year, 01 to 12 for month and 01 to 31 for day
34
34
  *
35
35
  * ___Does not enforce beginning and end of string___
36
- * @example '2022-12-31' (matches)
37
- * @example '2022-12-31T23:59:59.999Z' (matches)
38
- * @example '9992022-12-31' (matches)
36
+ * @example '2022-12-31'
37
+ * @example '2022-12-31T23:59:59.999Z'
38
+ * @example '9992022-12-31'
39
39
  */
40
40
  const dashedDateLoose = /([0-9]{4}-([0][1-9]|[1][0-2])-([1-2][0-9]|[0][1-9]|[3][0-1]))/;
41
41
  //#endregion
42
42
  //#region src/regexen/datetime/iso-utc.ts
43
43
  /**
44
44
  * Regex that matches a UTC ISO String Date in format YYYY-MM-DDTHH:mm:ss.sssZ
45
- * @example 2022-12-31T23:59:59.999Z (with milliseconds)
46
- * @example 2022-12-31T23:59:59Z (without milliseconds)
45
+ * @example 2022-12-31T23:59:59.999Z
46
+ * @example 2022-12-31T23:59:59Z
47
47
  */
48
48
  const isoUtc = /^\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}(?:\.\d{3})?Z$/;
49
49
  //#endregion
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","names":[],"sources":["../src/regexen/countries/br/cpf.ts","../src/regexen/countries/br/_index.ts","../src/regexen/countries/_index.ts","../src/regexen/datetime/dashed-date.ts","../src/regexen/datetime/dashed-date-loose.ts","../src/regexen/datetime/iso-utc.ts","../src/regexen/datetime/_index.ts"],"sourcesContent":["/**\n * Matches a Brazilian CPF number in the format XXX.XXX.XXX-XX\n *\n * ___Enforces beginning and end of string___\n * @example '123.456.789-09' (matches)\n * @example '12345678909' (does not match)\n */\nexport const cpf = /^\\d{3}\\.\\d{3}\\.\\d{3}-\\d{2}$/;\n","export * from './cpf.ts';\n","export * as br from './br/_index.ts';\n","/**\n * Matches a date in the format YYYY-MM-DD\n * Valid digits are 0000 to 9999 for year, 01 to 12 for month and 01 to 31 for day.\n *\n * ___Enforces beginning and end of string___\n * @example '2022-12-31' (matches)\n * @example '2022-12-31T23:59:59.999Z' (does not match)\n * @example '9992022-12-31' (does not match)\n */\nexport const dashedDate = /^([0-9]{4}-([0][1-9]|[1][0-2])-([1-2][0-9]|[0][1-9]|[3][0-1]))$/;\n","/**\n * Matches a date in the format YYYY-MM-DD\n * Valid digits are 0000 to 9999 for year, 01 to 12 for month and 01 to 31 for day\n *\n * ___Does not enforce beginning and end of string___\n * @example '2022-12-31' (matches)\n * @example '2022-12-31T23:59:59.999Z' (matches)\n * @example '9992022-12-31' (matches)\n */\nexport const dashedDateLoose = /([0-9]{4}-([0][1-9]|[1][0-2])-([1-2][0-9]|[0][1-9]|[3][0-1]))/;\n","/**\n * Regex that matches a UTC ISO String Date in format YYYY-MM-DDTHH:mm:ss.sssZ\n * @example 2022-12-31T23:59:59.999Z (with milliseconds)\n * @example 2022-12-31T23:59:59Z (without milliseconds)\n */\nexport const isoUtc = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{3})?Z$/;\n","export * from './dashed-date.ts';\nexport * from './dashed-date-loose.ts';\nexport * from './iso-utc.ts';\n"],"mappings":";;;;;;;;;AAOA,MAAa,MAAM;;;;;;;;;;;;;;;;;;AGEnB,MAAa,aAAa;;;;;;;;;;;;ACA1B,MAAa,kBAAkB;;;;;;;;ACJ/B,MAAa,SAAS"}
1
+ {"version":3,"file":"index.mjs","names":[],"sources":["../src/regexen/countries/br/cpf.ts","../src/regexen/countries/br/_index.ts","../src/regexen/countries/_index.ts","../src/regexen/datetime/dashed-date.ts","../src/regexen/datetime/dashed-date-loose.ts","../src/regexen/datetime/iso-utc.ts","../src/regexen/datetime/_index.ts"],"sourcesContent":["/**\n * Matches a Brazilian CPF number in the format XXX.XXX.XXX-XX\n *\n * ___Enforces beginning and end of string___\n * @example '123.456.789-09'\n * @example '12345678909'\n */\nexport const cpf = /^\\d{3}\\.\\d{3}\\.\\d{3}-\\d{2}$/;\n","export * from './cpf.ts';\n","export * as br from './br/_index.ts';\n","/**\n * Matches a date in the format YYYY-MM-DD\n * Valid digits are 0000 to 9999 for year, 01 to 12 for month and 01 to 31 for day.\n *\n * ___Enforces beginning and end of string___\n * @example '2022-12-31'\n * @example '2022-12-31T23:59:59.999Z'\n * @example '9992022-12-31'\n */\nexport const dashedDate = /^([0-9]{4}-([0][1-9]|[1][0-2])-([1-2][0-9]|[0][1-9]|[3][0-1]))$/;\n","/**\n * Matches a date in the format YYYY-MM-DD\n * Valid digits are 0000 to 9999 for year, 01 to 12 for month and 01 to 31 for day\n *\n * ___Does not enforce beginning and end of string___\n * @example '2022-12-31'\n * @example '2022-12-31T23:59:59.999Z'\n * @example '9992022-12-31'\n */\nexport const dashedDateLoose = /([0-9]{4}-([0][1-9]|[1][0-2])-([1-2][0-9]|[0][1-9]|[3][0-1]))/;\n","/**\n * Regex that matches a UTC ISO String Date in format YYYY-MM-DDTHH:mm:ss.sssZ\n * @example 2022-12-31T23:59:59.999Z\n * @example 2022-12-31T23:59:59Z\n */\nexport const isoUtc = /^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(?:\\.\\d{3})?Z$/;\n","export * from './dashed-date.ts';\nexport * from './dashed-date-loose.ts';\nexport * from './iso-utc.ts';\n"],"mappings":";;;;;;;;;AAOA,MAAa,MAAM;;;;;;;;;;;;;;;;;;AGEnB,MAAa,aAAa;;;;;;;;;;;;ACA1B,MAAa,kBAAkB;;;;;;;;ACJ/B,MAAa,SAAS"}
package/package.json CHANGED
@@ -10,7 +10,7 @@
10
10
  "patterns",
11
11
  "validation"
12
12
  ],
13
- "version": "0.1.7",
13
+ "version": "0.1.8",
14
14
  "sideEffects": false,
15
15
  "type": "module",
16
16
  "author": "Adriano Tirloni",