Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
strip(tagName, contents) {
let tree = html(contents);
const filter = childNodes => {
return childNodes.map(childNode => {
if (childNode.nodeName === tagName) {
return createElement('#text', null, ' ');
}
childNode.childNodes = filter(childNode.childNodes);
return childNode;
});
};
if (tree.childNodes) {
tree.childNodes = filter(tree.childNodes);
}
${params.map(tag => html`
${this.getName(tag.name)}
${tag.description ? html(tag.description) : 'n/a'}
<code>${this.getDefault(tag.name)}</code>
${String(!tag.optional)}
`)}
${examples.length ? examples.map(tag => html`
<pre><code class="javascript hljs">
${html(highlightAuto(this.trimCode(tag.string), ['javascript']).value)}
</code></pre>
`) : `No examples`}
${this.getName(tag.name)}
${tag.description ? html(tag.description) : 'n/a'}
<code>${this.getDefault(tag.name)}</code>
${String(!tag.optional)}
`)}
` : html`
No arguments to display
`}
<h5>Return value</h5>
${returnValue.length ? html`<p>
${returnValue[0].string}
</p>` : html('<code>undefined</code>')}
<div class="gap"></div>
<hr>
`;
})}