updated rule field styles
This commit is contained in:
@@ -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.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user