@scaleway/regex 1.4.2 → 2.2.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,45 @@
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
+ ## 2.2.0 (2022-01-19)
7
+
8
+
9
+ ### Features
10
+
11
+ * add alphaLower and basicDomain regex ([#600](https://github.com/scaleway/scaleway-lib/issues/600)) ([418bda9](https://github.com/scaleway/scaleway-lib/commit/418bda9db7c3c342565e01433461d78079bb1b76))
12
+
13
+
14
+
15
+ ## 2.1.0 (2021-11-23)
16
+
17
+
18
+ ### Features
19
+
20
+ * add absolute path regex ([#514](https://github.com/scaleway/scaleway-lib/issues/514)) ([f271d72](https://github.com/scaleway/scaleway-lib/commit/f271d7251198f2119480a02dce844a283452e061))
21
+
22
+
23
+
24
+ ## 2.0.0 (2021-07-20)
25
+
26
+
27
+ ### ⚠ BREAKING CHANGES
28
+
29
+ * migrate the codebase to typescript
30
+
31
+ ### Code Refactoring
32
+
33
+ * migrate to typescript ([#272](https://github.com/scaleway/scaleway-lib/issues/272)) ([3923c68](https://github.com/scaleway/scaleway-lib/commit/3923c68d6f7feadee7e2e30e32c9ef5d1f3003b9))
34
+
35
+
36
+
37
+ ### 1.4.3 (2021-05-11)
38
+
39
+ **Note:** Version bump only for package @scaleway/regex
40
+
41
+
42
+
43
+
44
+
6
45
  ### 1.4.2 (2021-05-10)
7
46
 
8
47
  **Note:** Version bump only for package @scaleway/regex
@@ -1,4 +1,5 @@
1
1
  const alpha = /^[a-zA-Z]*$/;
2
+ const alphaLower = /^[a-z]+$/;
2
3
  const alphanum = /^[a-zA-Z0-9]*$/;
3
4
  const alphanumdash = /^[a-zA-Z0-9-]*$/;
4
5
  const alphanumdashdots = /^[a-zA-Z0-9-.]*$/;
@@ -10,10 +11,12 @@ const alphanumdots = /^[a-zA-Z0-9.]*$/;
10
11
  const alphanumLowercase = /^[a-z0-9]+$/;
11
12
  const alphanumSpacesDotsUnderscoreDash = /^[a-zA-Z0-9-.\s_]*$/;
12
13
  const alphanumUnderscoreDash = /^[a-zA-Z0-9_-]*$/;
13
- const alphanumUnderscoreDollarDash = /^[a-zA-Z0-9_$-]*$/; // eslint-disable-next-line no-control-regex
14
+ const alphanumUnderscoreDollarDash = /^[a-zA-Z0-9_$-]*$/;
15
+ const absoluteLinuxPath = /(^\/$|^(\/[a-zA-Z0-9_]+)*$)/; // eslint-disable-next-line no-control-regex
14
16
 
15
17
  const ascii = /^[\x00-\x7F]+$/;
16
18
  const backupKey = /^[A-Z0-9]{32}$/;
19
+ const basicDomain = /^[a-z0-9-]+(\.[a-z0-9-]{1,63})+$/;
17
20
  const cron = /^[0-9,/*-]+$/;
18
21
  const digits = /^[0-9]*$/;
19
22
  const macAddress = /^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/; // Used by W3C
@@ -26,4 +29,4 @@ const sixDigitsCode = /^[0-9]{6}$/;
26
29
  const url = /^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/;
27
30
  const hexadecimal = /^[0-9a-fA-F]+$/;
28
31
 
29
- export { alpha, alphanum, alphanumLowercase, alphanumSpacesDotsUnderscoreDash, alphanumUnderscoreDash, alphanumUnderscoreDollarDash, alphanumdash, alphanumdashdots, alphanumdashdotsorempty, alphanumdashdotsspaces, alphanumdashorempty, alphanumdashspaces, alphanumdots, ascii, backupKey, cron, digits, email, fourDigitsCode, hexadecimal, macAddress, phone, sixDigitsCode, spaces, url };
32
+ export { absoluteLinuxPath, alpha, alphaLower, alphanum, alphanumLowercase, alphanumSpacesDotsUnderscoreDash, alphanumUnderscoreDash, alphanumUnderscoreDollarDash, alphanumdash, alphanumdashdots, alphanumdashdotsorempty, alphanumdashdotsspaces, alphanumdashorempty, alphanumdashspaces, alphanumdots, ascii, backupKey, basicDomain, cron, digits, email, fourDigitsCode, hexadecimal, macAddress, phone, sixDigitsCode, spaces, url };
@@ -0,0 +1,30 @@
1
+ declare const alpha: RegExp;
2
+ declare const alphaLower: RegExp;
3
+ declare const alphanum: RegExp;
4
+ declare const alphanumdash: RegExp;
5
+ declare const alphanumdashdots: RegExp;
6
+ declare const alphanumdashdotsorempty: RegExp;
7
+ declare const alphanumdashdotsspaces: RegExp;
8
+ declare const alphanumdashorempty: RegExp;
9
+ declare const alphanumdashspaces: RegExp;
10
+ declare const alphanumdots: RegExp;
11
+ declare const alphanumLowercase: RegExp;
12
+ declare const alphanumSpacesDotsUnderscoreDash: RegExp;
13
+ declare const alphanumUnderscoreDash: RegExp;
14
+ declare const alphanumUnderscoreDollarDash: RegExp;
15
+ declare const absoluteLinuxPath: RegExp;
16
+ declare const ascii: RegExp;
17
+ declare const backupKey: RegExp;
18
+ declare const basicDomain: RegExp;
19
+ declare const cron: RegExp;
20
+ declare const digits: RegExp;
21
+ declare const macAddress: RegExp;
22
+ declare const email: RegExp;
23
+ declare const fourDigitsCode: RegExp;
24
+ declare const phone: RegExp;
25
+ declare const spaces: RegExp;
26
+ declare const sixDigitsCode: RegExp;
27
+ declare const url: RegExp;
28
+ declare const hexadecimal: RegExp;
29
+
30
+ export { absoluteLinuxPath, alpha, alphaLower, alphanum, alphanumLowercase, alphanumSpacesDotsUnderscoreDash, alphanumUnderscoreDash, alphanumUnderscoreDollarDash, alphanumdash, alphanumdashdots, alphanumdashdotsorempty, alphanumdashdotsspaces, alphanumdashorempty, alphanumdashspaces, alphanumdots, ascii, backupKey, basicDomain, cron, digits, email, fourDigitsCode, hexadecimal, macAddress, phone, sixDigitsCode, spaces, url };
@@ -1,4 +1,5 @@
1
1
  const alpha = /^[a-zA-Z]*$/;
2
+ const alphaLower = /^[a-z]+$/;
2
3
  const alphanum = /^[a-zA-Z0-9]*$/;
3
4
  const alphanumdash = /^[a-zA-Z0-9-]*$/;
4
5
  const alphanumdashdots = /^[a-zA-Z0-9-.]*$/;
@@ -10,10 +11,12 @@ const alphanumdots = /^[a-zA-Z0-9.]*$/;
10
11
  const alphanumLowercase = /^[a-z0-9]+$/;
11
12
  const alphanumSpacesDotsUnderscoreDash = /^[a-zA-Z0-9-.\s_]*$/;
12
13
  const alphanumUnderscoreDash = /^[a-zA-Z0-9_-]*$/;
13
- const alphanumUnderscoreDollarDash = /^[a-zA-Z0-9_$-]*$/; // eslint-disable-next-line no-control-regex
14
+ const alphanumUnderscoreDollarDash = /^[a-zA-Z0-9_$-]*$/;
15
+ const absoluteLinuxPath = /(^\/$|^(\/[a-zA-Z0-9_]+)*$)/; // eslint-disable-next-line no-control-regex
14
16
 
15
17
  const ascii = /^[\x00-\x7F]+$/;
16
18
  const backupKey = /^[A-Z0-9]{32}$/;
19
+ const basicDomain = /^[a-z0-9-]+(\.[a-z0-9-]{1,63})+$/;
17
20
  const cron = /^[0-9,/*-]+$/;
18
21
  const digits = /^[0-9]*$/;
19
22
  const macAddress = /^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/; // Used by W3C
@@ -26,4 +29,4 @@ const sixDigitsCode = /^[0-9]{6}$/;
26
29
  const url = /^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/;
27
30
  const hexadecimal = /^[0-9a-fA-F]+$/;
28
31
 
29
- export { alpha, alphanum, alphanumLowercase, alphanumSpacesDotsUnderscoreDash, alphanumUnderscoreDash, alphanumUnderscoreDollarDash, alphanumdash, alphanumdashdots, alphanumdashdotsorempty, alphanumdashdotsspaces, alphanumdashorempty, alphanumdashspaces, alphanumdots, ascii, backupKey, cron, digits, email, fourDigitsCode, hexadecimal, macAddress, phone, sixDigitsCode, spaces, url };
32
+ export { absoluteLinuxPath, alpha, alphaLower, alphanum, alphanumLowercase, alphanumSpacesDotsUnderscoreDash, alphanumUnderscoreDash, alphanumUnderscoreDollarDash, alphanumdash, alphanumdashdots, alphanumdashdotsorempty, alphanumdashdotsspaces, alphanumdashorempty, alphanumdashspaces, alphanumdots, ascii, backupKey, basicDomain, cron, digits, email, fourDigitsCode, hexadecimal, macAddress, phone, sixDigitsCode, spaces, url };
package/package.json CHANGED
@@ -1,11 +1,13 @@
1
1
  {
2
2
  "name": "@scaleway/regex",
3
- "version": "1.4.2",
3
+ "version": "2.2.0",
4
4
  "description": "A small utility to use regex",
5
5
  "type": "module",
6
- "module": "dist/module.js",
6
+ "main": "dist/index.js",
7
+ "module": "dist/index.js",
8
+ "types": "dist/index.d.ts",
7
9
  "browser": {
8
- "dist/module.js": "./dist/module.browser.js"
10
+ "dist/index.js": "./dist/index.browser.js"
9
11
  },
10
12
  "publishConfig": {
11
13
  "access": "public"
@@ -16,5 +18,5 @@
16
18
  "directory": "packages/regex"
17
19
  },
18
20
  "license": "MIT",
19
- "gitHead": "4d70fd4740496e2a37462bcbc8c04065f6256bd7"
21
+ "gitHead": "2d1e948a9304197df015bc1f1734f94f36db671d"
20
22
  }