Add hyphen to valid rsn regex.

This commit is contained in:
maxswa committed 2021-05-01 14:09:08 -04:00
1 parent 163f4dd184
commit a4065022d6
2 files changed
+59 -38

No files matched your search

+1 -1
View File
@@ -39,7 +39,7 @@ import {
export async function getRSNFormat(rsn: string): Promise<string> {
if (typeof rsn !== 'string') {
throw Error('RSN must be a string');
} else if (!/^[a-zA-Z0-9 _]+$/.test(rsn)) {
} else if (!/^[a-zA-Z0-9 _-]+$/.test(rsn)) {
throw Error('RSN contains invalid character');
} else if (rsn.length > 12 || rsn.length < 1) {
throw Error('RSN must be between 1 and 12 characters');