Added a trim
This commit is contained in:
@@ -40,6 +40,7 @@ export default function BatchCodeGenerator({user}: {user: User}) {
|
|||||||
const file = filesContent[0];
|
const file = filesContent[0];
|
||||||
const emails = file.content
|
const emails = file.content
|
||||||
.split("\n")
|
.split("\n")
|
||||||
|
.map((x) => x.trim())
|
||||||
.filter((x) => new RegExp(/^[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*@[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*$/).test(x));
|
.filter((x) => new RegExp(/^[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*@[a-zA-Z0-9]+(?:\.[a-zA-Z0-9]+)*$/).test(x));
|
||||||
|
|
||||||
if (emails.length === 0) {
|
if (emails.length === 0) {
|
||||||
|
|||||||
Reference in New Issue
Block a user