mirror of
https://github.com/hexastack/hexabot
synced 2025-06-26 18:27:28 +00:00
fix(frontend): support one slash case
This commit is contained in:
parent
280cf7ee88
commit
fac05d3721
@ -32,7 +32,12 @@ import { ContentPostbackInput } from "./ContentPostbackInput";
|
|||||||
import { PostbackInput } from "./PostbackInput";
|
import { PostbackInput } from "./PostbackInput";
|
||||||
|
|
||||||
const isRegex = (str: Pattern) => {
|
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 => {
|
const getType = (pattern: Pattern): PatternType => {
|
||||||
if (isRegex(pattern)) {
|
if (isRegex(pattern)) {
|
||||||
|
Loading…
Reference in New Issue
Block a user