Support empty strings and strings with quotes for default (#10)

This commit is contained in:
1ilit
2024-04-10 04:57:07 +03:00
parent 9c34e6c40d
commit 895059c76a
3 changed files with 66 additions and 77 deletions

View File

@@ -14,3 +14,13 @@ export function dataURItoBlob(dataUrl) {
export function arrayIsEqual(arr1, arr2) {
return JSON.stringify(arr1) === JSON.stringify(arr2);
}
export function strHasQuotes(str) {
if (str.length < 2) return false;
return (
(str[0] === str[str.length - 1] && str[0] === "'") ||
(str[0] === str[str.length - 1] && str[0] === '"') ||
(str[0] === str[str.length - 1] && str[0] === "`")
);
}