This commit is contained in:
Rizky 2024-01-29 12:06:29 +07:00
parent 284fedc5c4
commit 148196f626
1 changed files with 10 additions and 7 deletions

View File

@ -55,16 +55,19 @@ export const EdPropInstanceText: FC<{
); );
}; };
const unquote = (text: string) => { const unquote = (text: any) => {
const str = text.trim(); if (typeof text === "string") {
const first = str[0]; const str = text.trim();
const first = str[0];
if (['"', "'", "`"].includes(first)) { if (['"', "'", "`"].includes(first)) {
if (first === str[str.length - 1]) { if (first === str[str.length - 1]) {
return str.slice(1, -1); return str.slice(1, -1);
}
} }
return str;
} }
return str; return "";
}; };
export function AutoHeightTextarea({ export function AutoHeightTextarea({