Skip to content

Commit

Permalink
fix: mock port variable
Browse files Browse the repository at this point in the history
  • Loading branch information
ioanmo226 committed Jan 3, 2025
1 parent 915610f commit 017ac27
Showing 1 changed file with 0 additions and 2 deletions.
2 changes: 0 additions & 2 deletions extension/js/common/core/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
import { base64decode, base64encode } from '../platform/util.js';
import { Xss } from '../platform/xss.js';
import { Buf } from './buf.js';
import { MOCK_PORT } from './const.js';

export type Dict<T> = { [key: string]: T };
export type UrlParam = string | number | null | undefined | boolean | string[];
Expand Down Expand Up @@ -160,7 +159,6 @@ export class Str {
if (email.includes(' ')) {
return false;
}
email = email.replace(new RegExp(`:${MOCK_PORT}$`), ''); // for MOCK tests, todo: remove from production
// `localhost` is a valid top-level domain for an email address, otherwise we require a second-level domain to be present
return /^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|localhost|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/i.test(
email
Expand Down

0 comments on commit 017ac27

Please sign in to comment.