Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
highlight: snippet => highlight(snippet, languages.javascript, 'javascript'),
/**
updateExampleValue(vat: string | undefined, countries: ReadonlyArray): void {
const code = checkVAT(vat, countries)
const codeStr = JSON.stringify(code, null, 2).replace(/"(\S+)":/g, '$1:')
if (code) this.code = highlight(codeStr, languages.javascript, 'javascript')
}
counterUpdate();
};
const counterUpdate = () => (input.value = val);
counterUpdate();
inputListener.subscribe('Down', counterDown);
inputListener.subscribe('Up', counterUp);
inputListener.subscribe('Escape', counterReset);
`;
const codeWrapper = document.getElementById('code');
const html = highlight(code, languages.javascript, 'javascript');
codeWrapper.innerHTML = '<pre class="language-javascript">' + html + '</pre>';
const CodeSnippet = ({ id, options }) => (
<div>
<pre> {snippets[id] ? renderHTML(highlight(snippets[id](options), languages.javascript)) : null};
</pre>
</div>
);