return
}
- const is32bitJava = !stderr.match(/64-Bit/)
+ const is32bitJava = !/64-Bit/.test(stderr)
// vnu-jar accepts multiple ignores joined with a `|`.
// Also note that the ignores are regular expressions.
_cleanTipClass() {
const tip = this.getTipElement()
const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX)
-
if (tabClass !== null && tabClass.length > 0) {
tabClass.map(token => token.trim())
.forEach(tClass => tip.classList.remove(tClass))
_cleanTipClass() {
const tip = this.getTipElement()
const tabClass = tip.getAttribute('class').match(BSCLS_PREFIX_REGEX)
- if (tabClass !== null && tabClass.length) {
- tabClass
- .map(token => token.trim())
+ if (tabClass !== null && tabClass.length > 0) {
+ tabClass.map(token => token.trim())
.forEach(tClass => tip.classList.remove(tClass))
}
}
if (allowedAttributeList.indexOf(attrName) !== -1) {
if (uriAttrs.indexOf(attrName) !== -1) {
- return Boolean(attr.nodeValue.match(SAFE_URL_PATTERN) || attr.nodeValue.match(DATA_URL_PATTERN))
+ return SAFE_URL_PATTERN.test(attr.nodeValue) || DATA_URL_PATTERN.test(attr.nodeValue)
}
return true
const regExp = allowedAttributeList.filter(attrRegex => attrRegex instanceof RegExp)
// Check if a regular expression validates the attribute.
- for (let i = 0, l = regExp.length; i < l; i++) {
- if (attrName.match(regExp[i])) {
+ for (let i = 0, len = regExp.length; i < len; i++) {
+ if (regExp[i].test(attrName)) {
return true
}
}