Skip to content

Commit

Permalink
🐛 Build supportedNode check for audio correctly
Browse files Browse the repository at this point in the history
  • Loading branch information
richardfrost committed Dec 26, 2019
1 parent 032942d commit 934eabe
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/script/webAudio.ts
Original file line number Diff line number Diff line change
Expand Up @@ -110,11 +110,11 @@ export default class WebAudio {
block += `
if (node.nodeName == '${rule.tagName.toUpperCase()}') {
let failed = false;
${rule.className ? `if (!node.className || !node.className.includes('${rule.className}')) { failed = true; }` : ''}
${rule.dataPropPresent ? `if (!failed && !node.dataset || !node.dataset.hasOwnProperty('${rule.dataPropPresent}')) { failed = true; }` : ''}
${rule.hasChildrenElements ? 'if (!failed && typeof node.childElementCount !== "number" || node.childElementCount < 1) { failed = true; }' : ''}
${rule.subtitleSelector ? `if (!failed && typeof node.querySelector !== 'function' || !node.querySelector('${rule.subtitleSelector}')) { failed = true; }` : ''}
${rule.containsSelector ? `if (!failed && typeof node.querySelector !== 'function' || !node.querySelector('${rule.containsSelector}')) { failed = true; }` : ''}
${rule.className ? `if (!failed && (!node.className || !node.className.includes('${rule.className}'))) { failed = true; }` : ''}
${rule.dataPropPresent ? `if (!failed && (!node.dataset || !node.dataset.hasOwnProperty('${rule.dataPropPresent}'))) { failed = true; }` : ''}
${rule.hasChildrenElements ? 'if (!failed && (typeof node.childElementCount !== "number" || node.childElementCount < 1)) { failed = true; }' : ''}
${rule.subtitleSelector ? `if (!failed && (typeof node.querySelector !== 'function' || !node.querySelector('${rule.subtitleSelector}'))) { failed = true; }` : ''}
${rule.containsSelector ? `if (!failed && (typeof node.querySelector !== 'function' || !node.querySelector('${rule.containsSelector}'))) { failed = true; }` : ''}
if (!failed) {
return ${index};
}
Expand Down

0 comments on commit 934eabe

Please sign in to comment.