@scaleway/regex 3.2.0 → 4.1.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/CHANGELOG.md CHANGED
@@ -1,5 +1,36 @@
1
1
  # Change Log
2
2
 
3
+ ## 4.1.0
4
+
5
+ ### Minor Changes
6
+
7
+ - [#1493](https://github.com/scaleway/scaleway-lib/pull/1493) [`7f4a667`](https://github.com/scaleway/scaleway-lib/commit/7f4a66773dfc3c90c6c3e8905cbfe8cb2a4c15f3) Thanks [@QuiiBz](https://github.com/QuiiBz)! - Add `pathSegment` and `absolutePath` regex
8
+
9
+ - [#1448](https://github.com/scaleway/scaleway-lib/pull/1448) [`809a9ac`](https://github.com/scaleway/scaleway-lib/commit/809a9ac4189d72bd8b8b4cd10631334060e39a41) Thanks [@johnrazeur](https://github.com/johnrazeur)! - Add subdomain regex
10
+
11
+ ## 4.0.0
12
+
13
+ ### Major Changes
14
+
15
+ - [#1442](https://github.com/scaleway/scaleway-lib/pull/1442) [`c39764e`](https://github.com/scaleway/scaleway-lib/commit/c39764e869fcce3471d6c2c4e35272c86ad24f90) Thanks [@vincentaudebert](https://github.com/vincentaudebert)! - Rename few regex and camelcase all of them for more consistency. Also creates alphanumDashUnderscoreDots.
16
+
17
+ Here is the full list of changes:
18
+
19
+ - alphaLower -> alphaLowercase
20
+ - alphanumdash -> alphanumDash
21
+ - alphanumdashdots -> alphanumDashDots
22
+ - alphanumdashdotsorempty -> alphanumDashDotsOrEmpty
23
+ - alphanumdashdotsspaces -> alphanumDashDotsSpaces
24
+ - alphanumdashunderscore -> alphanumDashUnderscore
25
+ - alphanumdashunderscoredotsspacesparenthesis -> alphanumDashUnderscoreDotsSpacesParenthesis
26
+ - alphanumdashorempty -> alphanumDashOrEmpty
27
+ - alphanumdashspaces -> alphanumDashSpaces
28
+ - alphanumdots -> alphanumDots
29
+ - alphanumdashLowercase -> alphanumDashLowercase
30
+ - alphanumSpacesDotsUnderscoreDash -> alphanumDashUnderscoreDotsSpaces
31
+ - alphanumUnderscoreDash -> alphanumDashUnderscore
32
+ - alphanumUnderscoreDollarDash -> alphanumDashUnderscoreDollar
33
+
3
34
  ## 3.2.0
4
35
 
5
36
  ### Minor Changes
package/dist/index.d.ts CHANGED
@@ -1,27 +1,28 @@
1
1
  declare const accessKeyRegex: RegExp;
2
2
  declare const alpha: RegExp;
3
- declare const alphaLower: RegExp;
3
+ declare const alphaLowercase: RegExp;
4
4
  declare const alphanum: RegExp;
5
5
  declare const alphaDashes: RegExp;
6
- declare const alphanumdash: RegExp;
7
- declare const alphanumdashdots: RegExp;
8
- declare const alphanumdashdotsorempty: RegExp;
9
- declare const alphanumdashdotsspaces: RegExp;
10
- declare const alphanumdashunderscore: RegExp;
11
- declare const alphanumdashunderscoredotsspacesparenthesis: RegExp;
12
- declare const alphanumdashorempty: RegExp;
13
- declare const alphanumdashspaces: RegExp;
14
- declare const alphanumdots: RegExp;
6
+ declare const alphanumDash: RegExp;
7
+ declare const alphanumDashDots: RegExp;
8
+ declare const alphanumDashDotsOrEmpty: RegExp;
9
+ declare const alphanumDashDotsSpaces: RegExp;
10
+ declare const alphanumDashLowercase: RegExp;
11
+ declare const alphanumDashSpaces: RegExp;
12
+ declare const alphanumDashOrEmpty: RegExp;
13
+ declare const alphanumDashUnderscoreDots: RegExp;
14
+ declare const alphanumDashUnderscore: RegExp;
15
+ declare const alphanumDashUnderscoreDotsSpacesParenthesis: RegExp;
16
+ declare const alphanumDashUnderscoreDotsSpaces: RegExp;
17
+ declare const alphanumDashUnderscoreDollar: RegExp;
18
+ declare const alphanumDots: RegExp;
15
19
  declare const alphanumLowercase: RegExp;
16
- declare const alphanumdashLowercase: RegExp;
17
- declare const alphanumSpacesDotsUnderscoreDash: RegExp;
18
- declare const alphanumUnderscoreDash: RegExp;
19
- declare const alphanumUnderscoreDollarDash: RegExp;
20
20
  declare const absoluteLinuxPath: RegExp;
21
21
  declare const ascii: RegExp;
22
22
  declare const backupKey: RegExp;
23
23
  declare const basicDomain: RegExp;
24
24
  declare const uppercaseBasicDomain: RegExp;
25
+ declare const uppercaseBasicSubdomain: RegExp;
25
26
  declare const advancedDomainName: RegExp;
26
27
  declare const cron: RegExp;
27
28
  declare const digits: RegExp;
@@ -42,5 +43,7 @@ declare const ipv4Cidr: RegExp;
42
43
  declare const ipv6Cidr: RegExp;
43
44
  declare const reverseDNS: RegExp;
44
45
  declare const dashedIpv4: RegExp;
46
+ declare const pathSegment: RegExp;
47
+ declare const absolutePath: RegExp;
45
48
 
46
- export { absoluteLinuxPath, accessKeyRegex, advancedDomainName, alpha, alphaDashes, alphaLower, alphanum, alphanumLowercase, alphanumSpacesDotsUnderscoreDash, alphanumUnderscoreDash, alphanumUnderscoreDollarDash, alphanumdash, alphanumdashLowercase, alphanumdashdots, alphanumdashdotsorempty, alphanumdashdotsspaces, alphanumdashorempty, alphanumdashspaces, alphanumdashunderscore, alphanumdashunderscoredotsspacesparenthesis, alphanumdots, ascii, backupKey, basicDomain, cron, dashedIpv4, digits, email, fourDigitsCode, hexadecimal, ip, ipCidr, ipv4, ipv4Cidr, ipv6, ipv6Cidr, macAddress, phone, reverseDNS, s3BucketName, sixDigitsCode, spaces, uppercaseBasicDomain, url };
49
+ export { absoluteLinuxPath, absolutePath, accessKeyRegex, advancedDomainName, alpha, alphaDashes, alphaLowercase, alphanum, alphanumDash, alphanumDashDots, alphanumDashDotsOrEmpty, alphanumDashDotsSpaces, alphanumDashLowercase, alphanumDashOrEmpty, alphanumDashSpaces, alphanumDashUnderscore, alphanumDashUnderscoreDollar, alphanumDashUnderscoreDots, alphanumDashUnderscoreDotsSpaces, alphanumDashUnderscoreDotsSpacesParenthesis, alphanumDots, alphanumLowercase, ascii, backupKey, basicDomain, cron, dashedIpv4, digits, email, fourDigitsCode, hexadecimal, ip, ipCidr, ipv4, ipv4Cidr, ipv6, ipv6Cidr, macAddress, pathSegment, phone, reverseDNS, s3BucketName, sixDigitsCode, spaces, uppercaseBasicDomain, uppercaseBasicSubdomain, url };
package/dist/index.js CHANGED
@@ -1,27 +1,28 @@
1
1
  const accessKeyRegex = /^SCW[A-Z0-9]{17}$/i;
2
2
  const alpha = /^[a-zA-Z]*$/;
3
- const alphaLower = /^[a-z]+$/;
3
+ const alphaLowercase = /^[a-z]+$/;
4
4
  const alphanum = /^[a-zA-Z0-9]*$/;
5
5
  const alphaDashes = /^[a-zA-Z-]*$/;
6
- const alphanumdash = /^[a-zA-Z0-9-]*$/;
7
- const alphanumdashdots = /^[a-zA-Z0-9-.]*$/;
8
- const alphanumdashdotsorempty = /^$|^[a-zA-Z0-9-.]*$/;
9
- const alphanumdashdotsspaces = /^[a-zA-Z0-9-.\s]*$/;
10
- const alphanumdashunderscore = /^[a-zA-Z0-9-_]*$/;
11
- const alphanumdashunderscoredotsspacesparenthesis = /^[a-zA-Z0-9-_.()\s]*$/;
12
- const alphanumdashorempty = /^$|^[a-zA-Z0-9-]*$/;
13
- const alphanumdashspaces = /^[a-zA-Z0-9-\s]*$/;
14
- const alphanumdots = /^[a-zA-Z0-9.]*$/;
6
+ const alphanumDash = /^[a-zA-Z0-9-]*$/;
7
+ const alphanumDashDots = /^[a-zA-Z0-9-.]*$/;
8
+ const alphanumDashDotsOrEmpty = /^$|^[a-zA-Z0-9-.]*$/;
9
+ const alphanumDashDotsSpaces = /^[a-zA-Z0-9-.\s]*$/;
10
+ const alphanumDashLowercase = /^[a-z0-9-]+$/;
11
+ const alphanumDashSpaces = /^[a-zA-Z0-9-\s]*$/;
12
+ const alphanumDashOrEmpty = /^$|^[a-zA-Z0-9-]*$/;
13
+ const alphanumDashUnderscoreDots = /^[a-zA-Z0-9-._]*$/;
14
+ const alphanumDashUnderscore = /^[a-zA-Z0-9-_]*$/;
15
+ const alphanumDashUnderscoreDotsSpacesParenthesis = /^[a-zA-Z0-9-_.()\s]*$/;
16
+ const alphanumDashUnderscoreDotsSpaces = /^[a-zA-Z0-9-.\s_]*$/;
17
+ const alphanumDashUnderscoreDollar = /^[a-zA-Z0-9_$-]*$/;
18
+ const alphanumDots = /^[a-zA-Z0-9.]*$/;
15
19
  const alphanumLowercase = /^[a-z0-9]+$/;
16
- const alphanumdashLowercase = /^[a-z0-9-]+$/;
17
- const alphanumSpacesDotsUnderscoreDash = /^[a-zA-Z0-9-.\s_]*$/;
18
- const alphanumUnderscoreDash = /^[a-zA-Z0-9_-]*$/;
19
- const alphanumUnderscoreDollarDash = /^[a-zA-Z0-9_$-]*$/;
20
20
  const absoluteLinuxPath = /(^\/$|^(\/[a-zA-Z0-9_]+)*$)/;
21
21
  const ascii = /^[\x00-\x7F]+$/;
22
22
  const backupKey = /^[A-Z0-9]{32}$/;
23
23
  const basicDomain = /^[a-z0-9-]+(\.[a-z0-9-]{1,63})+$/;
24
24
  const uppercaseBasicDomain = /^(?![-])+[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,63})+$/;
25
+ const uppercaseBasicSubdomain = /^(?![-])+[a-zA-Z0-9-]+\.[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,63})+$/;
25
26
  const advancedDomainName = /^(?:(?:(?:[a-zA-Z0-9À-ÖØ-öø-ÿ](?:[a-zA-Z0-9À-ÖØ-öø-ÿ-]{0,61}[a-zA-Z0-9À-ÖØ-öø-ÿ])?)\.)+[a-zA-Z]{2,}|(?:[0-9]{1,3}\.){3}[0-9]{1,3})(?::[\d]{1,5})?$/;
26
27
  const cron = /^((((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ?){5,7})$/;
27
28
  const digits = /^[0-9]*$/;
@@ -58,5 +59,7 @@ const ipv4Cidr = new RegExp(`^${cidrv4}$`);
58
59
  const ipv6Cidr = new RegExp(`^${cidrv6}$`);
59
60
  const reverseDNS = /^[a-z0-9-]+(\.[a-z0-9-]{1,63})+(\.)$/;
60
61
  const dashedIpv4 = /(\b25[0-5]|\b2[0-4][0-9]|\b[01]?[0-9][0-9]?)(-(25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}/;
62
+ const pathSegment = /^[_a-zA-Z0-9][-_.a-zA-Z0-9]*[_a-zA-Z0-9]$/;
63
+ const absolutePath = /^\/([_a-zA-Z0-9][-_.a-zA-Z0-9]*[_a-zA-Z0-9]\/?){1,10}$/;
61
64
 
62
- export { absoluteLinuxPath, accessKeyRegex, advancedDomainName, alpha, alphaDashes, alphaLower, alphanum, alphanumLowercase, alphanumSpacesDotsUnderscoreDash, alphanumUnderscoreDash, alphanumUnderscoreDollarDash, alphanumdash, alphanumdashLowercase, alphanumdashdots, alphanumdashdotsorempty, alphanumdashdotsspaces, alphanumdashorempty, alphanumdashspaces, alphanumdashunderscore, alphanumdashunderscoredotsspacesparenthesis, alphanumdots, ascii, backupKey, basicDomain, cron, dashedIpv4, digits, email, fourDigitsCode, hexadecimal, ip, ipCidr, ipv4, ipv4Cidr, ipv6, ipv6Cidr, macAddress, phone, reverseDNS, s3BucketName, sixDigitsCode, spaces, uppercaseBasicDomain, url };
65
+ export { absoluteLinuxPath, absolutePath, accessKeyRegex, advancedDomainName, alpha, alphaDashes, alphaLowercase, alphanum, alphanumDash, alphanumDashDots, alphanumDashDotsOrEmpty, alphanumDashDotsSpaces, alphanumDashLowercase, alphanumDashOrEmpty, alphanumDashSpaces, alphanumDashUnderscore, alphanumDashUnderscoreDollar, alphanumDashUnderscoreDots, alphanumDashUnderscoreDotsSpaces, alphanumDashUnderscoreDotsSpacesParenthesis, alphanumDots, alphanumLowercase, ascii, backupKey, basicDomain, cron, dashedIpv4, digits, email, fourDigitsCode, hexadecimal, ip, ipCidr, ipv4, ipv4Cidr, ipv6, ipv6Cidr, macAddress, pathSegment, phone, reverseDNS, s3BucketName, sixDigitsCode, spaces, uppercaseBasicDomain, uppercaseBasicSubdomain, url };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@scaleway/regex",
3
- "version": "3.2.0",
3
+ "version": "4.1.0",
4
4
  "description": "A small utility to use regex",
5
5
  "type": "module",
6
6
  "engines": {