mirror of
https://github.com/drawdb-io/drawdb.git
synced 2026-02-12 02:00:40 +08:00
Support empty strings and strings with quotes for default (#10)
This commit is contained in:
@@ -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] === "`")
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user