Skip to content
This repository has been archived by the owner on Jan 28, 2024. It is now read-only.

Commit

Permalink
perf(routes): consolidate regex alternatives into classes
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs committed Oct 8, 2023
1 parent 2afced4 commit a9141cf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/routes/admin/access/bearer-token/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const tags = ["System administration"];
*/
const dateTimeSearchPattern =
// eslint-disable-next-line security/detect-unsafe-regex
/^(?:ap|eb|eq|ge|gt|le|lt|ne|sa)?\d{4}-[01]\d-[0-3]\d(?:T(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:Z|[+-]\d{2}(?::?\d{2})?))?$/u;
/^(?:ap|e[bq]|g[et]|l[et]|ne|sa)?\d{4}-[01]\d-[0-3]\d(?:T(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:Z|[+-]\d{2}(?::?\d{2})?))?$/u;

const dateTimeSearchPatternExamples = [
"2022-01-13",
Expand Down
2 changes: 1 addition & 1 deletion src/routes/contact/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ const tags = ["Community contacts"];
*/
const dateTimeSearchPattern =
// eslint-disable-next-line security/detect-unsafe-regex
/^(?:ap|eb|eq|ge|gt|le|lt|ne|sa)?\d{4}-[01]\d-[0-3]\d(?:T(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:Z|[+-]\d{2}(?::?\d{2})?))?$/u;
/^(?:ap|e[bq]|g[et]|l[et]|ne|sa)?\d{4}-[01]\d-[0-3]\d(?:T(?:[0-2]\d:[0-5]\d:[0-5]\d|23:59:60)(?:\.\d+)?(?:Z|[+-]\d{2}(?::?\d{2})?))?$/u;

const dateTimeSearchPatternExamples = [
"2022-01-13",
Expand Down

0 comments on commit a9141cf

Please sign in to comment.