@scaleway/regex 2.4.0 → 2.5.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 +9 -0
- package/dist/index.browser.js +6 -1
- package/dist/index.d.ts +4 -1
- package/dist/index.js +6 -1
- package/package.json +2 -2
package/CHANGELOG.md
CHANGED
|
@@ -3,6 +3,15 @@
|
|
|
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.0 (2022-09-13)
|
|
7
|
+
|
|
8
|
+
|
|
9
|
+
### Features
|
|
10
|
+
|
|
11
|
+
* **regex:** add cidr regex ([#982](https://github.com/scaleway/scaleway-lib/issues/982)) ([dc32290](https://github.com/scaleway/scaleway-lib/commit/dc3229007463f7f1ab5267a2efd9851bb629b625))
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
|
|
6
15
|
## 2.4.0 (2022-09-08)
|
|
7
16
|
|
|
8
17
|
|
package/dist/index.browser.js
CHANGED
|
@@ -41,8 +41,13 @@ const v6 = `
|
|
|
41
41
|
(?::(?:(?::${v6segment}){0,5}:${v4}|(?::${v6segment}){1,7}|:))
|
|
42
42
|
)(?:%[0-9a-zA-Z]{1,})?
|
|
43
43
|
`.replace(/\s*\/\/.*$/gm, '').replace(/\n/g, '').trim();
|
|
44
|
+
const cidrv4 = `${v4}\\/(3[0-2]|[12]?[0-9])`;
|
|
45
|
+
const cidrv6 = `${v6}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`;
|
|
44
46
|
const ip = new RegExp(`^(?:${v4}|${v6})$`);
|
|
45
47
|
const ipv4 = new RegExp(`^${v4}$`);
|
|
46
48
|
const ipv6 = new RegExp(`^${v6}$`);
|
|
49
|
+
const ipCidr = new RegExp(`(?:^${cidrv4}$)|(?:^${cidrv6}$)`);
|
|
50
|
+
const ipv4Cidr = new RegExp(`^${cidrv4}$`);
|
|
51
|
+
const ipv6Cidr = new RegExp(`^${cidrv6}$`);
|
|
47
52
|
|
|
48
|
-
export { absoluteLinuxPath, alpha, alphaDashes, alphaLower, alphanum, alphanumLowercase, alphanumSpacesDotsUnderscoreDash, alphanumUnderscoreDash, alphanumUnderscoreDollarDash, alphanumdash, alphanumdashdots, alphanumdashdotsorempty, alphanumdashdotsspaces, alphanumdashorempty, alphanumdashspaces, alphanumdots, ascii, backupKey, basicDomain, cron, digits, email, fourDigitsCode, hexadecimal, ip, ipv4, ipv6, macAddress, phone, sixDigitsCode, spaces, url };
|
|
53
|
+
export { absoluteLinuxPath, alpha, alphaDashes, alphaLower, alphanum, alphanumLowercase, alphanumSpacesDotsUnderscoreDash, alphanumUnderscoreDash, alphanumUnderscoreDollarDash, alphanumdash, alphanumdashdots, alphanumdashdotsorempty, alphanumdashdotsspaces, alphanumdashorempty, alphanumdashspaces, alphanumdots, ascii, backupKey, basicDomain, cron, digits, email, fourDigitsCode, hexadecimal, ip, ipCidr, ipv4, ipv4Cidr, ipv6, ipv6Cidr, macAddress, phone, sixDigitsCode, spaces, url };
|
package/dist/index.d.ts
CHANGED
|
@@ -30,5 +30,8 @@ declare const hexadecimal: RegExp;
|
|
|
30
30
|
declare const ip: RegExp;
|
|
31
31
|
declare const ipv4: RegExp;
|
|
32
32
|
declare const ipv6: RegExp;
|
|
33
|
+
declare const ipCidr: RegExp;
|
|
34
|
+
declare const ipv4Cidr: RegExp;
|
|
35
|
+
declare const ipv6Cidr: RegExp;
|
|
33
36
|
|
|
34
|
-
export { absoluteLinuxPath, alpha, alphaDashes, alphaLower, alphanum, alphanumLowercase, alphanumSpacesDotsUnderscoreDash, alphanumUnderscoreDash, alphanumUnderscoreDollarDash, alphanumdash, alphanumdashdots, alphanumdashdotsorempty, alphanumdashdotsspaces, alphanumdashorempty, alphanumdashspaces, alphanumdots, ascii, backupKey, basicDomain, cron, digits, email, fourDigitsCode, hexadecimal, ip, ipv4, ipv6, macAddress, phone, sixDigitsCode, spaces, url };
|
|
37
|
+
export { absoluteLinuxPath, alpha, alphaDashes, alphaLower, alphanum, alphanumLowercase, alphanumSpacesDotsUnderscoreDash, alphanumUnderscoreDash, alphanumUnderscoreDollarDash, alphanumdash, alphanumdashdots, alphanumdashdotsorempty, alphanumdashdotsspaces, alphanumdashorempty, alphanumdashspaces, alphanumdots, ascii, backupKey, basicDomain, cron, digits, email, fourDigitsCode, hexadecimal, ip, ipCidr, ipv4, ipv4Cidr, ipv6, ipv6Cidr, macAddress, phone, sixDigitsCode, spaces, url };
|
package/dist/index.js
CHANGED
|
@@ -41,8 +41,13 @@ const v6 = `
|
|
|
41
41
|
(?::(?:(?::${v6segment}){0,5}:${v4}|(?::${v6segment}){1,7}|:))
|
|
42
42
|
)(?:%[0-9a-zA-Z]{1,})?
|
|
43
43
|
`.replace(/\s*\/\/.*$/gm, '').replace(/\n/g, '').trim();
|
|
44
|
+
const cidrv4 = `${v4}\\/(3[0-2]|[12]?[0-9])`;
|
|
45
|
+
const cidrv6 = `${v6}\\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])`;
|
|
44
46
|
const ip = new RegExp(`^(?:${v4}|${v6})$`);
|
|
45
47
|
const ipv4 = new RegExp(`^${v4}$`);
|
|
46
48
|
const ipv6 = new RegExp(`^${v6}$`);
|
|
49
|
+
const ipCidr = new RegExp(`(?:^${cidrv4}$)|(?:^${cidrv6}$)`);
|
|
50
|
+
const ipv4Cidr = new RegExp(`^${cidrv4}$`);
|
|
51
|
+
const ipv6Cidr = new RegExp(`^${cidrv6}$`);
|
|
47
52
|
|
|
48
|
-
export { absoluteLinuxPath, alpha, alphaDashes, alphaLower, alphanum, alphanumLowercase, alphanumSpacesDotsUnderscoreDash, alphanumUnderscoreDash, alphanumUnderscoreDollarDash, alphanumdash, alphanumdashdots, alphanumdashdotsorempty, alphanumdashdotsspaces, alphanumdashorempty, alphanumdashspaces, alphanumdots, ascii, backupKey, basicDomain, cron, digits, email, fourDigitsCode, hexadecimal, ip, ipv4, ipv6, macAddress, phone, sixDigitsCode, spaces, url };
|
|
53
|
+
export { absoluteLinuxPath, alpha, alphaDashes, alphaLower, alphanum, alphanumLowercase, alphanumSpacesDotsUnderscoreDash, alphanumUnderscoreDash, alphanumUnderscoreDollarDash, alphanumdash, alphanumdashdots, alphanumdashdotsorempty, alphanumdashdotsspaces, alphanumdashorempty, alphanumdashspaces, alphanumdots, ascii, backupKey, basicDomain, cron, digits, email, fourDigitsCode, hexadecimal, ip, ipCidr, ipv4, ipv4Cidr, ipv6, ipv6Cidr, macAddress, phone, sixDigitsCode, spaces, url };
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@scaleway/regex",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.5.0",
|
|
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": "f404667dfd218b43e811786ecce2b9553b2c65a8"
|
|
22
22
|
}
|