updated rule field styles

This commit is contained in:
Gani Georgiev
2023-03-23 22:59:02 +02:00
parent 7a2360d785
commit d8b4daf47f
34 changed files with 237 additions and 150 deletions
+21
View File
@@ -466,6 +466,27 @@ export default class CommonHelper {
return str
}
/**
* Trims the matching quotes from the provided value.
*
* The value will be returned unchanged if `val` is not
* wrapped with quotes or it is not string.
*
* @param {Mixed} val
* @return {Mixed}
*/
static trimQuotedValue(val) {
if (
typeof val == "string" &&
(val[0] == `"` || val[0] == `'` || val[0] == "`") &&
val[0] == val[val.length-1]
) {
return val.slice(1, -1);
}
return val
}
/**
* Returns the plain text version (aka. strip tags) of the provided string.
*