Skip to content

Commit

Permalink
refactor: remove redundant multi line regex flags (#1386)
Browse files Browse the repository at this point in the history
  • Loading branch information
Fdawgs authored Apr 2, 2023
1 parent a316506 commit 2ac4e74
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 9 deletions.
2 changes: 1 addition & 1 deletion src/config/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ async function getConfig() {
S.anyOf([
// daily, date, [1-12]h, or [1-30]m
S.string().pattern(
/^(?:daily|date|(?:[1-9]|1[012])h|(?:[1-9]|[1-2][0-9]|30)m)$/m
/^(?:daily|date|(?:[1-9]|1[012])h|(?:[1-9]|[1-2][0-9]|30)m)$/
),
S.null(),
])
Expand Down
3 changes: 1 addition & 2 deletions src/plugins/shared-schemas/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,8 +59,7 @@ async function plugin(server) {
.prop("error", S.string().const("Unsupported Media Type"))
.prop(
"message",
// JSON Schema does not support Regex flags, added for posterity
S.string().pattern(/^Unsupported Media Type.*$/m)
S.string().pattern(/^Unsupported Media Type.*$/)
)
)
.prop(
Expand Down
4 changes: 2 additions & 2 deletions src/routes/docx/html/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ const docxToHtmlPostSchema = {
.description(
"HTML document background color; replace the `background-color` CSS property for `<div>` elements"
)
.pattern(/^[#a-zA-Z0-9()%, .]+$/m)
.pattern(/^[#a-zA-Z0-9()%, .]+$/)
.examples([
"white",
"#FFFFFF",
Expand All @@ -49,7 +49,7 @@ const docxToHtmlPostSchema = {
.description(
"Set the `lang` and `xml:lang` attributes of the `<html>` tag. Must be a valid IANA language tag"
)
.pattern(/^[-a-zA-Z0-9]+$/m)
.pattern(/^[-a-zA-Z0-9]+$/)
.default("en")
)
.prop(
Expand Down
4 changes: 2 additions & 2 deletions src/routes/pdf/html/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const pdfToHtmlPostSchema = {
.description(
"HTML document background color; replace the `background-color` CSS property for `<div>` elements"
)
.pattern(/^[#a-zA-Z0-9()%, .]+$/m)
.pattern(/^[#a-zA-Z0-9()%, .]+$/)
.examples([
"white",
"#FFFFFF",
Expand Down Expand Up @@ -76,7 +76,7 @@ const pdfToHtmlPostSchema = {
.description(
"Set the `lang` and `xml:lang` attributes of the `<html>` tag. Must be a valid IANA language tag"
)
.pattern(/^[-a-zA-Z0-9]+$/m)
.pattern(/^[-a-zA-Z0-9]+$/)
.default("en")
)
.prop(
Expand Down
4 changes: 2 additions & 2 deletions src/routes/rtf/html/schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const rtfToHtmlPostSchema = {
.description(
"HTML document background color; replace the `background-color` CSS property for `<div>` elements"
)
.pattern(/^[#a-zA-Z0-9()%, .]+$/m)
.pattern(/^[#a-zA-Z0-9()%, .]+$/)
.examples([
"white",
"#FFFFFF",
Expand All @@ -47,7 +47,7 @@ const rtfToHtmlPostSchema = {
.description(
"Set the `lang` and `xml:lang` attributes of the `<html>` tag. Must be a valid IANA language tag"
)
.pattern(/^[-a-zA-Z0-9]+$/m)
.pattern(/^[-a-zA-Z0-9]+$/)
.default("en")
)
.prop(
Expand Down

0 comments on commit 2ac4e74

Please sign in to comment.