Code style: wrap regex
This commit is contained in:
parent
8405504be6
commit
05ea59029f
|
@ -65,7 +65,7 @@ manipulateDOM._removeCrossOriginAndIntegrityAttr = function (details) {
|
|||
charset = (/charset\s*=/).test(header.value) && header.value.replace(/^.*?charset\s*=\s*/, '').replace(/["']?/g, '');
|
||||
|
||||
// Check if charset is supported by TextDecoder()
|
||||
if (/charset\s*=/.test(header.value) && !EncodingTypes[charset.toString().toLowerCase()]) {
|
||||
if ((/charset\s*=/).test(header.value) && !EncodingTypes[charset.toString().toLowerCase()]) {
|
||||
console.error(`[ LocalCDN ] Unsupported charset: ${charset}`);
|
||||
log.append(details.url, '-', `Unsupported charset: ${charset}`, true);
|
||||
return;
|
||||
|
|
|
@ -46,7 +46,7 @@ requestAnalyzer.isValidCandidate = function (requestDetails, tabDetails) {
|
|||
|
||||
// Font Awesome injections in Chromium deactivated (https://gitlab.com/nobody42/localcdn/-/issues/67)
|
||||
if (BrowserType.CHROMIUM) {
|
||||
if (/(font-awesome|fontawesome)/.test(requestDetails.url)) {
|
||||
if ((/(font-awesome|fontawesome)/).test(requestDetails.url)) {
|
||||
console.warn(`${LogString.PREFIX} ${LogString.FONT_AWESOME}`);
|
||||
log.append(tabDetails.url, requestDetails.url, LogString.FONT_AWESOME, true);
|
||||
return false;
|
||||
|
|
|
@ -168,7 +168,7 @@ shorthands.specialFiles = function (channelHost, channelPath, searchString) {
|
|||
'path': `resources/twitter-bootstrap/fonts/${helpers.extractFilenameFromPath(channelPath)}`,
|
||||
'bundle': 'Bootstrap (Fonts)'
|
||||
};
|
||||
} else if (/cdnjs\.cloudflare\.com\/ajax\/libs\/jquery\.cycle2\/[\d.]+\//.test(CompleteURL)) {
|
||||
} else if ((/cdnjs\.cloudflare\.com\/ajax\/libs\/jquery\.cycle2\/[\d.]+\//).test(CompleteURL)) {
|
||||
if (channelPath.endsWith('js')) {
|
||||
channelPath += 'm';
|
||||
}
|
||||
|
@ -201,7 +201,7 @@ shorthands.specialFiles = function (channelHost, channelPath, searchString) {
|
|||
'path': `resources/materialize/1.0.0/${channelPath}`,
|
||||
'bundle': 'Materialize'
|
||||
};
|
||||
} else if (/cdn\.jsdelivr\.net\/npm\/vue@(2|3)/.test(CompleteURL)) {
|
||||
} else if ((/cdn\.jsdelivr\.net\/npm\/vue@(2|3)/).test(CompleteURL)) {
|
||||
let version = CompleteURL.match(Resource.VERSION_EXPRESSION);
|
||||
lastVersion = targets.setLastVersion(`/vue/${version}.`);
|
||||
if (lastVersion === false) {
|
||||
|
|
|
@ -139,7 +139,7 @@ helpers.normalizeDomain = function (domain) {
|
|||
};
|
||||
|
||||
helpers.extractDomainFromUrl = function (url, normalize) {
|
||||
if (/^(?!(http[s]?|file):\/\/).*/.test(url)) {
|
||||
if ((/^(?!(http[s]?|file):\/\/).*/).test(url)) {
|
||||
return null;
|
||||
}
|
||||
|
||||
|
|
|
@ -173,7 +173,7 @@ optionsOther._onChangedHexColor = function ({target}) {
|
|||
return;
|
||||
}
|
||||
|
||||
if (/#([a-f0-9]{3}){1,2}\b/i.test(target.value)) {
|
||||
if ((/#([a-f0-9]{3}){1,2}\b/i).test(target.value)) {
|
||||
target.classList.remove('color-error');
|
||||
if (target.id === element.BADGED_TEXT_COLOR) {
|
||||
let txtColor = target.value;
|
||||
|
|
Loading…
Reference in New Issue