@scaleway/regex 2.9.1 → 3.0.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
@@ -3,6 +3,24 @@
3
3
  All notable changes to this project will be documented in this file.
4
4
  See [Conventional Commits](https://conventionalcommits.org) for commit guidelines.
5
5
 
6
+ ## 3.0.0 (2023-01-06)
7
+
8
+
9
+ ### ⚠ BREAKING CHANGES
10
+
11
+ * packages are ESM only
12
+
13
+ ### :package: Chore
14
+
15
+ * **release:** publish ([20c9d4f](https://github.com/scaleway/scaleway-lib/commit/20c9d4fb39822245252bf362bc7a8d26127e511d))
16
+
17
+
18
+ ### :gear: Features
19
+
20
+ * publish packages as ESM only ([#1145](https://github.com/scaleway/scaleway-lib/issues/1145)) ([4c25097](https://github.com/scaleway/scaleway-lib/commit/4c25097254a5ba7f0a5dbb6fdf5d6578a75f777a))
21
+
22
+
23
+
6
24
  ## 2.9.1 (2022-12-29)
7
25
 
8
26
  ### Bug Fixes
package/package.json CHANGED
@@ -1,15 +1,15 @@
1
1
  {
2
2
  "name": "@scaleway/regex",
3
- "version": "2.9.1",
3
+ "version": "3.0.0",
4
4
  "description": "A small utility to use regex",
5
5
  "type": "module",
6
+ "engines": {
7
+ "node": ">=14.x"
8
+ },
9
+ "sideEffects": false,
6
10
  "main": "dist/index.js",
7
11
  "module": "dist/index.js",
8
12
  "types": "dist/index.d.ts",
9
- "sideEffects": false,
10
- "browser": {
11
- "dist/index.js": "./dist/index.browser.js"
12
- },
13
13
  "publishConfig": {
14
14
  "access": "public"
15
15
  },
@@ -19,5 +19,5 @@
19
19
  "directory": "packages/regex"
20
20
  },
21
21
  "license": "MIT",
22
- "gitHead": "6f4e0715a61e04c1eae8e3ba28199ac99f47c818"
22
+ "gitHead": "e80144e529c96b01905b0ee29029d0edbd916e61"
23
23
  }
@@ -1,59 +0,0 @@
1
- const alpha = /^[a-zA-Z]*$/;
2
- const alphaLower = /^[a-z]+$/;
3
- const alphanum = /^[a-zA-Z0-9]*$/;
4
- const alphaDashes = /^[a-zA-Z-]*$/;
5
- const alphanumdash = /^[a-zA-Z0-9-]*$/;
6
- const alphanumdashdots = /^[a-zA-Z0-9-.]*$/;
7
- const alphanumdashdotsorempty = /^$|^[a-zA-Z0-9-.]*$/;
8
- const alphanumdashdotsspaces = /^[a-zA-Z0-9-.\s]*$/;
9
- const alphanumdashunderscoredotsspacesparenthesis = /^[a-zA-Z0-9-_.()\s]*$/;
10
- const alphanumdashorempty = /^$|^[a-zA-Z0-9-]*$/;
11
- const alphanumdashspaces = /^[a-zA-Z0-9-\s]*$/;
12
- const alphanumdots = /^[a-zA-Z0-9.]*$/;
13
- const alphanumLowercase = /^[a-z0-9]+$/;
14
- const alphanumdashLowercase = /^[a-z0-9-]+$/;
15
- const alphanumSpacesDotsUnderscoreDash = /^[a-zA-Z0-9-.\s_]*$/;
16
- const alphanumUnderscoreDash = /^[a-zA-Z0-9_-]*$/;
17
- const alphanumUnderscoreDollarDash = /^[a-zA-Z0-9_$-]*$/;
18
- const absoluteLinuxPath = /(^\/$|^(\/[a-zA-Z0-9_]+)*$)/;
19
- const ascii = /^[\x00-\x7F]+$/;
20
- const backupKey = /^[A-Z0-9]{32}$/;
21
- const basicDomain = /^[a-z0-9-]+(\.[a-z0-9-]{1,63})+$/;
22
- const uppercaseBasicDomain = /^(?![-])+[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,63})+$/;
23
- const cron = /^((((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ?){5,7})$/;
24
- const digits = /^[0-9]*$/;
25
- const macAddress = /^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/;
26
- const email = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
27
- const fourDigitsCode = /^[0-9]{4}$/;
28
- const phone = /^\+[0-9]*/;
29
- const spaces = /^\s*$/;
30
- const sixDigitsCode = /^[0-9]{6}$/;
31
- const url = /^http(s)?:\/\/?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=.]+$/;
32
- const hexadecimal = /^[0-9a-fA-F]+$/;
33
- const s3BucketName = /^[a-z0-9][-.a-z0-9]{1,61}[a-z0-9]$/;
34
- const v4 = '(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)(?:\\.(?:25[0-5]|2[0-4]\\d|1\\d\\d|[1-9]\\d|\\d)){3}';
35
- const v6segment = '[a-fA-F\\d]{1,4}';
36
- const v6 = `
37
- (?:
38
- (?:${v6segment}:){7}(?:${v6segment}|:)|
39
- (?:${v6segment}:){6}(?:${v4}|:${v6segment}|:)|
40
- (?:${v6segment}:){5}(?::${v4}|(?::${v6segment}){1,2}|:)|
41
- (?:${v6segment}:){4}(?:(?::${v6segment}){0,1}:${v4}|(?::${v6segment}){1,3}|:)|
42
- (?:${v6segment}:){3}(?:(?::${v6segment}){0,2}:${v4}|(?::${v6segment}){1,4}|:)|
43
- (?:${v6segment}:){2}(?:(?::${v6segment}){0,3}:${v4}|(?::${v6segment}){1,5}|:)|
44
- (?:${v6segment}:){1}(?:(?::${v6segment}){0,4}:${v4}|(?::${v6segment}){1,6}|:)|
45
- (?::(?:(?::${v6segment}){0,5}:${v4}|(?::${v6segment}){1,7}|:))
46
- )(?:%[0-9a-zA-Z]{1,})?
47
- `.replace(/\s*\/\/.*$/gm, '').replace(/\n/g, '').trim();
48
- const cidrv4 = `${v4}\\/(3[0-2]|[12]?[0-9])`;
49
- const cidrv6 = `${v6}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`;
50
- const ip = new RegExp(`^(?:${v4}|${v6})$`);
51
- const ipv4 = new RegExp(`^${v4}$`);
52
- const ipv6 = new RegExp(`^${v6}$`);
53
- const ipCidr = new RegExp(`(?:^${cidrv4}$)|(?:^${cidrv6}$)`);
54
- const ipv4Cidr = new RegExp(`^${cidrv4}$`);
55
- const ipv6Cidr = new RegExp(`^${cidrv6}$`);
56
- const reverseDNS = /^[a-z0-9-]+(\.[a-z0-9-]{1,63})+(\.)$/;
57
- 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}/;
58
-
59
- export { absoluteLinuxPath, alpha, alphaDashes, alphaLower, alphanum, alphanumLowercase, alphanumSpacesDotsUnderscoreDash, alphanumUnderscoreDash, alphanumUnderscoreDollarDash, alphanumdash, alphanumdashLowercase, alphanumdashdots, alphanumdashdotsorempty, alphanumdashdotsspaces, alphanumdashorempty, alphanumdashspaces, 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 };