@scaleway/regex 2.5.2 → 2.5.3
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 +18 -80
- package/dist/index.browser.js +4 -1
- package/dist/index.js +4 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,174 +3,112 @@
|
|
|
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.5.
|
|
7
|
-
|
|
8
|
-
**Note:** Version bump only for package @scaleway/regex
|
|
6
|
+
## 2.5.3 (2022-11-17)
|
|
9
7
|
|
|
8
|
+
### Bug Fixes
|
|
10
9
|
|
|
10
|
+
- cron regex ([#1079](https://github.com/scaleway/scaleway-lib/issues/1079)) ([deb52ae](https://github.com/scaleway/scaleway-lib/commit/deb52aead1ff5ec81c443ca8a7f737c822a3da36))
|
|
11
11
|
|
|
12
|
+
## 2.5.2 (2022-09-23)
|
|
12
13
|
|
|
14
|
+
**Note:** Version bump only for package @scaleway/regex
|
|
13
15
|
|
|
14
16
|
## 2.5.1 (2022-09-19)
|
|
15
17
|
|
|
16
18
|
**Note:** Version bump only for package @scaleway/regex
|
|
17
19
|
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
20
|
## 2.5.0 (2022-09-13)
|
|
23
21
|
|
|
24
|
-
|
|
25
22
|
### Features
|
|
26
23
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
24
|
+
- **regex:** add cidr regex ([#982](https://github.com/scaleway/scaleway-lib/issues/982)) ([dc32290](https://github.com/scaleway/scaleway-lib/commit/dc3229007463f7f1ab5267a2efd9851bb629b625))
|
|
30
25
|
|
|
31
26
|
## 2.4.0 (2022-09-08)
|
|
32
27
|
|
|
33
|
-
|
|
34
28
|
### Features
|
|
35
29
|
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
30
|
+
- **regex:** add ip regexes ([#972](https://github.com/scaleway/scaleway-lib/issues/972)) ([98c6ded](https://github.com/scaleway/scaleway-lib/commit/98c6deda557af0cd41b1a6064946af2dea6680c2))
|
|
39
31
|
|
|
40
32
|
## 2.3.0 (2022-08-01)
|
|
41
33
|
|
|
42
|
-
|
|
43
34
|
### Features
|
|
44
35
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
36
|
+
- add new regex `alphaDashes` to the list ([#901](https://github.com/scaleway/scaleway-lib/issues/901)) ([608f823](https://github.com/scaleway/scaleway-lib/commit/608f8230badb68dcbcb5eab95c1661f97652a042))
|
|
48
37
|
|
|
49
38
|
### 2.2.3 (2022-04-26)
|
|
50
39
|
|
|
51
|
-
|
|
52
40
|
### Bug Fixes
|
|
53
41
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
42
|
+
- **regex:** improve url regex ([#736](https://github.com/scaleway/scaleway-lib/issues/736)) ([c340227](https://github.com/scaleway/scaleway-lib/commit/c340227da34141c978237e7659404df84e680d7a))
|
|
57
43
|
|
|
58
44
|
### 2.2.2 (2022-04-05)
|
|
59
45
|
|
|
60
46
|
**Note:** Version bump only for package @scaleway/regex
|
|
61
47
|
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
48
|
### 2.2.1 (2022-03-11)
|
|
67
49
|
|
|
68
50
|
**Note:** Version bump only for package @scaleway/regex
|
|
69
51
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
52
|
## 2.2.0 (2022-01-19)
|
|
75
53
|
|
|
76
|
-
|
|
77
54
|
### Features
|
|
78
55
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
56
|
+
- add alphaLower and basicDomain regex ([#600](https://github.com/scaleway/scaleway-lib/issues/600)) ([418bda9](https://github.com/scaleway/scaleway-lib/commit/418bda9db7c3c342565e01433461d78079bb1b76))
|
|
82
57
|
|
|
83
58
|
## 2.1.0 (2021-11-23)
|
|
84
59
|
|
|
85
|
-
|
|
86
60
|
### Features
|
|
87
61
|
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
62
|
+
- add absolute path regex ([#514](https://github.com/scaleway/scaleway-lib/issues/514)) ([f271d72](https://github.com/scaleway/scaleway-lib/commit/f271d7251198f2119480a02dce844a283452e061))
|
|
91
63
|
|
|
92
64
|
## 2.0.0 (2021-07-20)
|
|
93
65
|
|
|
94
|
-
|
|
95
66
|
### ⚠ BREAKING CHANGES
|
|
96
67
|
|
|
97
|
-
|
|
68
|
+
- migrate the codebase to typescript
|
|
98
69
|
|
|
99
70
|
### Code Refactoring
|
|
100
71
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
72
|
+
- migrate to typescript ([#272](https://github.com/scaleway/scaleway-lib/issues/272)) ([3923c68](https://github.com/scaleway/scaleway-lib/commit/3923c68d6f7feadee7e2e30e32c9ef5d1f3003b9))
|
|
104
73
|
|
|
105
74
|
### 1.4.3 (2021-05-11)
|
|
106
75
|
|
|
107
76
|
**Note:** Version bump only for package @scaleway/regex
|
|
108
77
|
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
78
|
### 1.4.2 (2021-05-10)
|
|
114
79
|
|
|
115
80
|
**Note:** Version bump only for package @scaleway/regex
|
|
116
81
|
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
82
|
### 1.4.1 (2021-04-15)
|
|
122
83
|
|
|
123
|
-
|
|
124
84
|
### Bug Fixes
|
|
125
85
|
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
86
|
+
- add hexa regex ([#130](https://github.com/scaleway/scaleway-lib/issues/130)) ([a67e2e6](https://github.com/scaleway/scaleway-lib/commit/a67e2e65db928816bfa745bcf6f9631811e7640d))
|
|
129
87
|
|
|
130
88
|
# 1.4.0 (2021-03-12)
|
|
131
89
|
|
|
132
|
-
|
|
133
90
|
### Features
|
|
134
91
|
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
92
|
+
- add mac address regex ([#67](https://github.com/scaleway/scaleway-lib/issues/67)) ([a4d8c83](https://github.com/scaleway/scaleway-lib/commit/a4d8c8300f1d8503ca0f8bbfbb8a4595fc24123c))
|
|
140
93
|
|
|
141
94
|
## [1.3.1](https://github.com/scaleway/scaleway-lib/compare/@scaleway/regex@1.3.0...@scaleway/regex@1.3.1) (2021-02-15)
|
|
142
95
|
|
|
143
96
|
**Note:** Version bump only for package @scaleway/regex
|
|
144
97
|
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
98
|
# [1.3.0](https://github.com/scaleway/scaleway-lib/compare/@scaleway/regex@1.2.0...@scaleway/regex@1.3.0) (2021-02-15)
|
|
150
99
|
|
|
151
|
-
|
|
152
100
|
### Features
|
|
153
101
|
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
102
|
+
- **eslint:** enable not yet enabled react plugin rules from airbnb ([#27](https://github.com/scaleway/scaleway-lib/issues/27)) ([78c9692](https://github.com/scaleway/scaleway-lib/commit/78c9692fe56ca308e49fb1bb9ac80b5a6217a6f3))
|
|
159
103
|
|
|
160
104
|
# 1.2.0 (2021-01-28)
|
|
161
105
|
|
|
162
|
-
|
|
163
106
|
### Features
|
|
164
107
|
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
108
|
+
- **regex:** add deploy package ([b288c6f](https://github.com/scaleway/scaleway-lib/commit/b288c6f06bd6107064f5ea74acb2207954ec08e2))
|
|
170
109
|
|
|
171
110
|
# 1.1.0 (2020-11-09)
|
|
172
111
|
|
|
173
|
-
|
|
174
112
|
### Features
|
|
175
113
|
|
|
176
|
-
|
|
114
|
+
- **regex:** add deploy package ([7fd5f83](https://github.com/scaleway/scaleway-lib/commit/7fd5f83f31737dc11946bb9bcbd16cf443c4af0d))
|
package/dist/index.browser.js
CHANGED
|
@@ -14,11 +14,12 @@ const alphanumSpacesDotsUnderscoreDash = /^[a-zA-Z0-9-.\s_]*$/;
|
|
|
14
14
|
const alphanumUnderscoreDash = /^[a-zA-Z0-9_-]*$/;
|
|
15
15
|
const alphanumUnderscoreDollarDash = /^[a-zA-Z0-9_$-]*$/;
|
|
16
16
|
const absoluteLinuxPath = /(^\/$|^(\/[a-zA-Z0-9_]+)*$)/;
|
|
17
|
+
|
|
17
18
|
const ascii = /^[\x00-\x7F]+$/;
|
|
18
19
|
const backupKey = /^[A-Z0-9]{32}$/;
|
|
19
20
|
const basicDomain = /^[a-z0-9-]+(\.[a-z0-9-]{1,63})+$/;
|
|
20
21
|
const uppercaseBasicDomain = /^(?![-])+[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,63})+$/;
|
|
21
|
-
const cron = /^
|
|
22
|
+
const cron = /^((((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ?){5,7})$/;
|
|
22
23
|
const digits = /^[0-9]*$/;
|
|
23
24
|
const macAddress = /^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/;
|
|
24
25
|
const email = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
|
|
@@ -28,6 +29,7 @@ const spaces = /^\s*$/;
|
|
|
28
29
|
const sixDigitsCode = /^[0-9]{6}$/;
|
|
29
30
|
const url = /^http(s)?:\/\/?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=.]+$/;
|
|
30
31
|
const hexadecimal = /^[0-9a-fA-F]+$/;
|
|
32
|
+
|
|
31
33
|
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}';
|
|
32
34
|
const v6segment = '[a-fA-F\\d]{1,4}';
|
|
33
35
|
const v6 = `
|
|
@@ -42,6 +44,7 @@ const v6 = `
|
|
|
42
44
|
(?::(?:(?::${v6segment}){0,5}:${v4}|(?::${v6segment}){1,7}|:))
|
|
43
45
|
)(?:%[0-9a-zA-Z]{1,})?
|
|
44
46
|
`.replace(/\s*\/\/.*$/gm, '').replace(/\n/g, '').trim();
|
|
47
|
+
|
|
45
48
|
const cidrv4 = `${v4}\\/(3[0-2]|[12]?[0-9])`;
|
|
46
49
|
const cidrv6 = `${v6}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`;
|
|
47
50
|
const ip = new RegExp(`^(?:${v4}|${v6})$`);
|
package/dist/index.js
CHANGED
|
@@ -14,11 +14,12 @@ const alphanumSpacesDotsUnderscoreDash = /^[a-zA-Z0-9-.\s_]*$/;
|
|
|
14
14
|
const alphanumUnderscoreDash = /^[a-zA-Z0-9_-]*$/;
|
|
15
15
|
const alphanumUnderscoreDollarDash = /^[a-zA-Z0-9_$-]*$/;
|
|
16
16
|
const absoluteLinuxPath = /(^\/$|^(\/[a-zA-Z0-9_]+)*$)/;
|
|
17
|
+
|
|
17
18
|
const ascii = /^[\x00-\x7F]+$/;
|
|
18
19
|
const backupKey = /^[A-Z0-9]{32}$/;
|
|
19
20
|
const basicDomain = /^[a-z0-9-]+(\.[a-z0-9-]{1,63})+$/;
|
|
20
21
|
const uppercaseBasicDomain = /^(?![-])+[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,63})+$/;
|
|
21
|
-
const cron = /^
|
|
22
|
+
const cron = /^((((\d+,)+\d+|(\d+(\/|-)\d+)|\d+|\*) ?){5,7})$/;
|
|
22
23
|
const digits = /^[0-9]*$/;
|
|
23
24
|
const macAddress = /^([0-9a-fA-F][0-9a-fA-F]:){5}([0-9a-fA-F][0-9a-fA-F])$/;
|
|
24
25
|
const email = /^[a-zA-Z0-9.!#$%&’*+/=?^_`{|}~-]+@[a-zA-Z0-9-]+(?:\.[a-zA-Z0-9-]+)*$/;
|
|
@@ -28,6 +29,7 @@ const spaces = /^\s*$/;
|
|
|
28
29
|
const sixDigitsCode = /^[0-9]{6}$/;
|
|
29
30
|
const url = /^http(s)?:\/\/?[\w.-]+(?:\.[\w.-]+)+[\w\-._~:/?#[\]@!$&'()*+,;=.]+$/;
|
|
30
31
|
const hexadecimal = /^[0-9a-fA-F]+$/;
|
|
32
|
+
|
|
31
33
|
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}';
|
|
32
34
|
const v6segment = '[a-fA-F\\d]{1,4}';
|
|
33
35
|
const v6 = `
|
|
@@ -42,6 +44,7 @@ const v6 = `
|
|
|
42
44
|
(?::(?:(?::${v6segment}){0,5}:${v4}|(?::${v6segment}){1,7}|:))
|
|
43
45
|
)(?:%[0-9a-zA-Z]{1,})?
|
|
44
46
|
`.replace(/\s*\/\/.*$/gm, '').replace(/\n/g, '').trim();
|
|
47
|
+
|
|
45
48
|
const cidrv4 = `${v4}\\/(3[0-2]|[12]?[0-9])`;
|
|
46
49
|
const cidrv6 = `${v6}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`;
|
|
47
50
|
const ip = new RegExp(`^(?:${v4}|${v6})$`);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/regex",
|
|
3
|
-
"version": "2.5.
|
|
3
|
+
"version": "2.5.3",
|
|
4
4
|
"description": "A small utility to use regex",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -18,5 +18,5 @@
|
|
|
18
18
|
"directory": "packages/regex"
|
|
19
19
|
},
|
|
20
20
|
"license": "MIT",
|
|
21
|
-
"gitHead": "
|
|
21
|
+
"gitHead": "ad81bfc131adaa1e198e9d19cd1b2f0ace0934d9"
|
|
22
22
|
}
|