Or just simplify by combining both conditions...

This commit is contained in:
Raymond Hill 2020-07-05 09:17:06 -04:00
parent 37f5b3d642
commit cd1a3d22cd
No known key found for this signature in database
GPG Key ID: 25E1490B761470C2
1 changed files with 4 additions and 9 deletions

View File

@ -681,14 +681,9 @@ const filterToDOMInterface = (( ) => {
for ( const elem of elems ) { for ( const elem of elems ) {
const srcProp = netFilter1stSources[elem.localName]; const srcProp = netFilter1stSources[elem.localName];
const src = elem[srcProp]; const src = elem[srcProp];
if ( typeof src === 'string' && reFilter.test(src) ) { if (
out.push({ typeof src === 'string' &&
type: 'network', reFilter.test(src) ||
elem: elem,
src: srcProp,
opts: filterTypes[elem.localName],
});
} else if (
typeof elem.currentSrc === 'string' && typeof elem.currentSrc === 'string' &&
reFilter.test(elem.currentSrc) reFilter.test(elem.currentSrc)
) { ) {