@scaleway/regex 1.4.1 → 2.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
@@ -3,6 +3,44 @@
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.1.0 (2021-11-23)
7
+
8
+
9
+ ### Features
10
+
11
+ * add absolute path regex ([#514](https://github.com/scaleway/scaleway-lib/issues/514)) ([f271d72](https://github.com/scaleway/scaleway-lib/commit/f271d7251198f2119480a02dce844a283452e061))
12
+
13
+
14
+
15
+ ## 2.0.0 (2021-07-20)
16
+
17
+
18
+ ### ⚠ BREAKING CHANGES
19
+
20
+ * migrate the codebase to typescript
21
+
22
+ ### Code Refactoring
23
+
24
+ * migrate to typescript ([#272](https://github.com/scaleway/scaleway-lib/issues/272)) ([3923c68](https://github.com/scaleway/scaleway-lib/commit/3923c68d6f7feadee7e2e30e32c9ef5d1f3003b9))
25
+
26
+
27
+
28
+ ### 1.4.3 (2021-05-11)
29
+
30
+ **Note:** Version bump only for package @scaleway/regex
31
+
32
+
33
+
34
+
35
+
36
+ ### 1.4.2 (2021-05-10)
37
+
38
+ **Note:** Version bump only for package @scaleway/regex
39
+
40
+
41
+
42
+
43
+
6
44
  ### 1.4.1 (2021-04-15)
7
45
 
8
46
 
@@ -1,63 +1,30 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['@scaleway/regex'] = {}));
5
- }(this, (function (exports) { 'use strict';
1
+ const alpha = /^[a-zA-Z]*$/;
2
+ const alphanum = /^[a-zA-Z0-9]*$/;
3
+ const alphanumdash = /^[a-zA-Z0-9-]*$/;
4
+ const alphanumdashdots = /^[a-zA-Z0-9-.]*$/;
5
+ const alphanumdashdotsorempty = /^$|^[a-zA-Z0-9-.]*$/;
6
+ const alphanumdashdotsspaces = /^[a-zA-Z0-9-.\s]*$/;
7
+ const alphanumdashorempty = /^$|^[a-zA-Z0-9-]*$/;
8
+ const alphanumdashspaces = /^[a-zA-Z0-9-\s]*$/;
9
+ const alphanumdots = /^[a-zA-Z0-9.]*$/;
10
+ const alphanumLowercase = /^[a-z0-9]+$/;
11
+ const alphanumSpacesDotsUnderscoreDash = /^[a-zA-Z0-9-.\s_]*$/;
12
+ const alphanumUnderscoreDash = /^[a-zA-Z0-9_-]*$/;
13
+ const alphanumUnderscoreDollarDash = /^[a-zA-Z0-9_$-]*$/;
14
+ const absoluteLinuxPath = /(^\/$|^(\/[a-zA-Z0-9_]+)*$)/; // eslint-disable-next-line no-control-regex
6
15
 
7
- const alpha = /^[a-zA-Z]*$/;
8
- const alphanum = /^[a-zA-Z0-9]*$/;
9
- const alphanumdash = /^[a-zA-Z0-9-]*$/;
10
- const alphanumdashdots = /^[a-zA-Z0-9-.]*$/;
11
- const alphanumdashdotsorempty = /^$|^[a-zA-Z0-9-.]*$/;
12
- const alphanumdashdotsspaces = /^[a-zA-Z0-9-.\s]*$/;
13
- const alphanumdashorempty = /^$|^[a-zA-Z0-9-]*$/;
14
- const alphanumdashspaces = /^[a-zA-Z0-9-\s]*$/;
15
- const alphanumdots = /^[a-zA-Z0-9.]*$/;
16
- const alphanumLowercase = /^[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_$-]*$/; // eslint-disable-next-line no-control-regex
16
+ const ascii = /^[\x00-\x7F]+$/;
17
+ const backupKey = /^[A-Z0-9]{32}$/;
18
+ const cron = /^[0-9,/*-]+$/;
19
+ const digits = /^[0-9]*$/;
20
+ const macAddress = /^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/; // Used by W3C
20
21
 
21
- const ascii = /^[\x00-\x7F]+$/;
22
- const backupKey = /^[A-Z0-9]{32}$/;
23
- const cron = /^[0-9,/*-]+$/;
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])$/; // Used by W3C
22
+ const email = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
23
+ const fourDigitsCode = /^[0-9]{4}$/;
24
+ const phone = /^\+[0-9]*/;
25
+ const spaces = /^\s*$/;
26
+ const sixDigitsCode = /^[0-9]{6}$/;
27
+ const url = /^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/;
28
+ const hexadecimal = /^[0-9a-fA-F]+$/;
26
29
 
27
- const email = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
28
- const fourDigitsCode = /^[0-9]{4}$/;
29
- const phone = /^\+[0-9]*/;
30
- const spaces = /^\s*$/;
31
- const sixDigitsCode = /^[0-9]{6}$/;
32
- const url = /^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/;
33
- const hexadecimal = /^[0-9a-fA-F]+$/;
34
-
35
- exports.alpha = alpha;
36
- exports.alphanum = alphanum;
37
- exports.alphanumLowercase = alphanumLowercase;
38
- exports.alphanumSpacesDotsUnderscoreDash = alphanumSpacesDotsUnderscoreDash;
39
- exports.alphanumUnderscoreDash = alphanumUnderscoreDash;
40
- exports.alphanumUnderscoreDollarDash = alphanumUnderscoreDollarDash;
41
- exports.alphanumdash = alphanumdash;
42
- exports.alphanumdashdots = alphanumdashdots;
43
- exports.alphanumdashdotsorempty = alphanumdashdotsorempty;
44
- exports.alphanumdashdotsspaces = alphanumdashdotsspaces;
45
- exports.alphanumdashorempty = alphanumdashorempty;
46
- exports.alphanumdashspaces = alphanumdashspaces;
47
- exports.alphanumdots = alphanumdots;
48
- exports.ascii = ascii;
49
- exports.backupKey = backupKey;
50
- exports.cron = cron;
51
- exports.digits = digits;
52
- exports.email = email;
53
- exports.fourDigitsCode = fourDigitsCode;
54
- exports.hexadecimal = hexadecimal;
55
- exports.macAddress = macAddress;
56
- exports.phone = phone;
57
- exports.sixDigitsCode = sixDigitsCode;
58
- exports.spaces = spaces;
59
- exports.url = url;
60
-
61
- Object.defineProperty(exports, '__esModule', { value: true });
62
-
63
- })));
30
+ export { absoluteLinuxPath, 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 };
@@ -0,0 +1,28 @@
1
+ declare const alpha: RegExp;
2
+ declare const alphanum: RegExp;
3
+ declare const alphanumdash: RegExp;
4
+ declare const alphanumdashdots: RegExp;
5
+ declare const alphanumdashdotsorempty: RegExp;
6
+ declare const alphanumdashdotsspaces: RegExp;
7
+ declare const alphanumdashorempty: RegExp;
8
+ declare const alphanumdashspaces: RegExp;
9
+ declare const alphanumdots: RegExp;
10
+ declare const alphanumLowercase: RegExp;
11
+ declare const alphanumSpacesDotsUnderscoreDash: RegExp;
12
+ declare const alphanumUnderscoreDash: RegExp;
13
+ declare const alphanumUnderscoreDollarDash: RegExp;
14
+ declare const absoluteLinuxPath: RegExp;
15
+ declare const ascii: RegExp;
16
+ declare const backupKey: RegExp;
17
+ declare const cron: RegExp;
18
+ declare const digits: RegExp;
19
+ declare const macAddress: RegExp;
20
+ declare const email: RegExp;
21
+ declare const fourDigitsCode: RegExp;
22
+ declare const phone: RegExp;
23
+ declare const spaces: RegExp;
24
+ declare const sixDigitsCode: RegExp;
25
+ declare const url: RegExp;
26
+ declare const hexadecimal: RegExp;
27
+
28
+ export { absoluteLinuxPath, 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 };
package/dist/index.js CHANGED
@@ -1,63 +1,30 @@
1
- (function (global, factory) {
2
- typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports) :
3
- typeof define === 'function' && define.amd ? define(['exports'], factory) :
4
- (global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global['@scaleway/regex'] = {}));
5
- }(this, (function (exports) { 'use strict';
1
+ const alpha = /^[a-zA-Z]*$/;
2
+ const alphanum = /^[a-zA-Z0-9]*$/;
3
+ const alphanumdash = /^[a-zA-Z0-9-]*$/;
4
+ const alphanumdashdots = /^[a-zA-Z0-9-.]*$/;
5
+ const alphanumdashdotsorempty = /^$|^[a-zA-Z0-9-.]*$/;
6
+ const alphanumdashdotsspaces = /^[a-zA-Z0-9-.\s]*$/;
7
+ const alphanumdashorempty = /^$|^[a-zA-Z0-9-]*$/;
8
+ const alphanumdashspaces = /^[a-zA-Z0-9-\s]*$/;
9
+ const alphanumdots = /^[a-zA-Z0-9.]*$/;
10
+ const alphanumLowercase = /^[a-z0-9]+$/;
11
+ const alphanumSpacesDotsUnderscoreDash = /^[a-zA-Z0-9-.\s_]*$/;
12
+ const alphanumUnderscoreDash = /^[a-zA-Z0-9_-]*$/;
13
+ const alphanumUnderscoreDollarDash = /^[a-zA-Z0-9_$-]*$/;
14
+ const absoluteLinuxPath = /(^\/$|^(\/[a-zA-Z0-9_]+)*$)/; // eslint-disable-next-line no-control-regex
6
15
 
7
- const alpha = /^[a-zA-Z]*$/;
8
- const alphanum = /^[a-zA-Z0-9]*$/;
9
- const alphanumdash = /^[a-zA-Z0-9-]*$/;
10
- const alphanumdashdots = /^[a-zA-Z0-9-.]*$/;
11
- const alphanumdashdotsorempty = /^$|^[a-zA-Z0-9-.]*$/;
12
- const alphanumdashdotsspaces = /^[a-zA-Z0-9-.\s]*$/;
13
- const alphanumdashorempty = /^$|^[a-zA-Z0-9-]*$/;
14
- const alphanumdashspaces = /^[a-zA-Z0-9-\s]*$/;
15
- const alphanumdots = /^[a-zA-Z0-9.]*$/;
16
- const alphanumLowercase = /^[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_$-]*$/; // eslint-disable-next-line no-control-regex
16
+ const ascii = /^[\x00-\x7F]+$/;
17
+ const backupKey = /^[A-Z0-9]{32}$/;
18
+ const cron = /^[0-9,/*-]+$/;
19
+ const digits = /^[0-9]*$/;
20
+ const macAddress = /^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/; // Used by W3C
20
21
 
21
- const ascii = /^[\x00-\x7F]+$/;
22
- const backupKey = /^[A-Z0-9]{32}$/;
23
- const cron = /^[0-9,/*-]+$/;
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])$/; // Used by W3C
22
+ const email = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
23
+ const fourDigitsCode = /^[0-9]{4}$/;
24
+ const phone = /^\+[0-9]*/;
25
+ const spaces = /^\s*$/;
26
+ const sixDigitsCode = /^[0-9]{6}$/;
27
+ const url = /^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/;
28
+ const hexadecimal = /^[0-9a-fA-F]+$/;
26
29
 
27
- const email = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
28
- const fourDigitsCode = /^[0-9]{4}$/;
29
- const phone = /^\+[0-9]*/;
30
- const spaces = /^\s*$/;
31
- const sixDigitsCode = /^[0-9]{6}$/;
32
- const url = /^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/;
33
- const hexadecimal = /^[0-9a-fA-F]+$/;
34
-
35
- exports.alpha = alpha;
36
- exports.alphanum = alphanum;
37
- exports.alphanumLowercase = alphanumLowercase;
38
- exports.alphanumSpacesDotsUnderscoreDash = alphanumSpacesDotsUnderscoreDash;
39
- exports.alphanumUnderscoreDash = alphanumUnderscoreDash;
40
- exports.alphanumUnderscoreDollarDash = alphanumUnderscoreDollarDash;
41
- exports.alphanumdash = alphanumdash;
42
- exports.alphanumdashdots = alphanumdashdots;
43
- exports.alphanumdashdotsorempty = alphanumdashdotsorempty;
44
- exports.alphanumdashdotsspaces = alphanumdashdotsspaces;
45
- exports.alphanumdashorempty = alphanumdashorempty;
46
- exports.alphanumdashspaces = alphanumdashspaces;
47
- exports.alphanumdots = alphanumdots;
48
- exports.ascii = ascii;
49
- exports.backupKey = backupKey;
50
- exports.cron = cron;
51
- exports.digits = digits;
52
- exports.email = email;
53
- exports.fourDigitsCode = fourDigitsCode;
54
- exports.hexadecimal = hexadecimal;
55
- exports.macAddress = macAddress;
56
- exports.phone = phone;
57
- exports.sixDigitsCode = sixDigitsCode;
58
- exports.spaces = spaces;
59
- exports.url = url;
60
-
61
- Object.defineProperty(exports, '__esModule', { value: true });
62
-
63
- })));
30
+ export { absoluteLinuxPath, 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 };
package/package.json CHANGED
@@ -1,12 +1,13 @@
1
1
  {
2
2
  "name": "@scaleway/regex",
3
- "version": "1.4.1",
3
+ "version": "2.1.0",
4
4
  "description": "A small utility to use regex",
5
+ "type": "module",
5
6
  "main": "dist/index.js",
6
- "module": "dist/module.js",
7
+ "module": "dist/index.js",
8
+ "types": "dist/index.d.ts",
7
9
  "browser": {
8
- "dist/index.js": "./dist/index.browser.js",
9
- "dist/module.js": "./dist/module.browser.js"
10
+ "dist/index.js": "./dist/index.browser.js"
10
11
  },
11
12
  "publishConfig": {
12
13
  "access": "public"
@@ -17,5 +18,5 @@
17
18
  "directory": "packages/regex"
18
19
  },
19
20
  "license": "MIT",
20
- "gitHead": "52df9eb4c7196f08a77afc3369aa949dc184f186"
21
+ "gitHead": "64aa3fdb7907402a1d24de9d884e7fae321b10e5"
21
22
  }
@@ -1,29 +0,0 @@
1
- const alpha = /^[a-zA-Z]*$/;
2
- const alphanum = /^[a-zA-Z0-9]*$/;
3
- const alphanumdash = /^[a-zA-Z0-9-]*$/;
4
- const alphanumdashdots = /^[a-zA-Z0-9-.]*$/;
5
- const alphanumdashdotsorempty = /^$|^[a-zA-Z0-9-.]*$/;
6
- const alphanumdashdotsspaces = /^[a-zA-Z0-9-.\s]*$/;
7
- const alphanumdashorempty = /^$|^[a-zA-Z0-9-]*$/;
8
- const alphanumdashspaces = /^[a-zA-Z0-9-\s]*$/;
9
- const alphanumdots = /^[a-zA-Z0-9.]*$/;
10
- const alphanumLowercase = /^[a-z0-9]+$/;
11
- const alphanumSpacesDotsUnderscoreDash = /^[a-zA-Z0-9-.\s_]*$/;
12
- const alphanumUnderscoreDash = /^[a-zA-Z0-9_-]*$/;
13
- const alphanumUnderscoreDollarDash = /^[a-zA-Z0-9_$-]*$/; // eslint-disable-next-line no-control-regex
14
-
15
- const ascii = /^[\x00-\x7F]+$/;
16
- const backupKey = /^[A-Z0-9]{32}$/;
17
- const cron = /^[0-9,/*-]+$/;
18
- const digits = /^[0-9]*$/;
19
- const macAddress = /^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/; // Used by W3C
20
-
21
- const email = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
22
- const fourDigitsCode = /^[0-9]{4}$/;
23
- const phone = /^\+[0-9]*/;
24
- const spaces = /^\s*$/;
25
- const sixDigitsCode = /^[0-9]{6}$/;
26
- const url = /^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/;
27
- const hexadecimal = /^[0-9a-fA-F]+$/;
28
-
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 };
package/dist/module.js DELETED
@@ -1,29 +0,0 @@
1
- const alpha = /^[a-zA-Z]*$/;
2
- const alphanum = /^[a-zA-Z0-9]*$/;
3
- const alphanumdash = /^[a-zA-Z0-9-]*$/;
4
- const alphanumdashdots = /^[a-zA-Z0-9-.]*$/;
5
- const alphanumdashdotsorempty = /^$|^[a-zA-Z0-9-.]*$/;
6
- const alphanumdashdotsspaces = /^[a-zA-Z0-9-.\s]*$/;
7
- const alphanumdashorempty = /^$|^[a-zA-Z0-9-]*$/;
8
- const alphanumdashspaces = /^[a-zA-Z0-9-\s]*$/;
9
- const alphanumdots = /^[a-zA-Z0-9.]*$/;
10
- const alphanumLowercase = /^[a-z0-9]+$/;
11
- const alphanumSpacesDotsUnderscoreDash = /^[a-zA-Z0-9-.\s_]*$/;
12
- const alphanumUnderscoreDash = /^[a-zA-Z0-9_-]*$/;
13
- const alphanumUnderscoreDollarDash = /^[a-zA-Z0-9_$-]*$/; // eslint-disable-next-line no-control-regex
14
-
15
- const ascii = /^[\x00-\x7F]+$/;
16
- const backupKey = /^[A-Z0-9]{32}$/;
17
- const cron = /^[0-9,/*-]+$/;
18
- const digits = /^[0-9]*$/;
19
- const macAddress = /^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/; // Used by W3C
20
-
21
- const email = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
22
- const fourDigitsCode = /^[0-9]{4}$/;
23
- const phone = /^\+[0-9]*/;
24
- const spaces = /^\s*$/;
25
- const sixDigitsCode = /^[0-9]{6}$/;
26
- const url = /^(http:\/\/www\.|https:\/\/www\.|http:\/\/|https:\/\/)?[a-z0-9]+([-.]{1}[a-z0-9]+)*\.[a-z]{2,5}(:[0-9]{1,5})?(\/.*)?$/;
27
- const hexadecimal = /^[0-9a-fA-F]+$/;
28
-
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 };