fix(frontend): support one slash case

This commit is contained in:
yassinedorbozgithub 2024-10-26 10:03:51 +01:00
parent 280cf7ee88
commit fac05d3721

View File

@ -32,7 +32,12 @@ import { ContentPostbackInput } from "./ContentPostbackInput";
import { PostbackInput } from "./PostbackInput";
const isRegex = (str: Pattern) => {
return typeof str === "string" && str.startsWith("/") && str.endsWith("/");
return (
typeof str === "string" &&
str.startsWith("/") &&
str.endsWith("/") &&
str.length > 1
);
};
const getType = (pattern: Pattern): PatternType => {
if (isRegex(pattern)) {