Skip to content

Commit a4851d2

Browse files
authored
feat(regex): update regex for backupkey (#2728)
1 parent 51517b3 commit a4851d2

File tree

3 files changed

+7
-2
lines changed

3 files changed

+7
-2
lines changed

.changeset/gold-poems-begin.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
---
2+
"@scaleway/regex": minor
3+
---
4+
5+
feat(regex): update regex for backupkey

packages/regex/src/__tests__/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -521,7 +521,7 @@ describe('@regex', () => {
521521
[backupKeyTest, true],
522522
[digitsTest, false],
523523
[emailTest, false],
524-
[octdigits, false],
524+
[octdigits, true],
525525
[hexdigits, false],
526526
[printable, false],
527527
[punctuation, false],

packages/regex/src/index.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ export const absoluteLinuxPath = /(^\/$|^(\/[a-zA-Z0-9_]+)*$)/
2424

2525
// eslint-disable-next-line no-control-regex
2626
export const ascii = /^[\x00-\x7F]+$/
27-
export const backupKey = /^[A-Z0-9]{32}$/
27+
export const backupKey = /^[A-Z0-9]{8}$|^[A-Z0-9]{32}$/
2828
export const basicDomain = /^[a-z0-9-]+(\.[a-z0-9-]{1,63})+$/
2929
export const uppercaseBasicDomain =
3030
/^(?![-])+[a-zA-Z0-9-]+(\.[a-zA-Z0-9-]{1,63})+$/

0 commit comments

Comments
 (0)