Skip to content

Commit 9b206b1

Browse files
authored
Improve steamID validators (#530)
* Improve steamID validators They're still not perfect, but much stronger now * Go one step further
1 parent b5c1e7d commit 9b206b1

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

src/validators.js

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,8 @@ export default {
8989

9090
const err = [];
9191

92-
const re = /^[1-9][0-9]{16}$/;
92+
// Range 76561197960265729-76561202255233023
93+
const re = /^76561[1-2][0-9]{11}$/;
9394
if (!re.test(value)) err.push('This is not a valid steamid!');
9495

9596
return err;
@@ -100,7 +101,8 @@ export default {
100101

101102
const err = [];
102103

103-
const re = /^[1-9][0-9]{17}$/;
104+
// Range 103582791429521408-103582795724488703
105+
const re = /^10358279[1-5][0-9]{9}$/;
104106
if (!re.test(value)) err.push('This is not a valid clan id!');
105107

106108
return err;

0 commit comments

Comments
 (0)