@scaleway/regex 4.0.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,13 @@
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
+
3
11
  ## 4.0.0
4
12
 
5
13
  ### Major Changes
package/dist/index.d.ts CHANGED
@@ -22,6 +22,7 @@ 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, 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, 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
@@ -22,6 +22,7 @@ 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, 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, 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": "4.0.0",
3
+ "version": "4.1.0",
4
4
  "description": "A small utility to use regex",
5
5
  "type": "module",
6
6
  "engines": {