Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
getJsLibraries(targetNode, platform) {
if (platform === TargetPlatform.JS || platform === TargetPlatform.CANVAS) {
const jsLibs = targetNode.getAttribute(ATTRIBUTES.JS_LIBS);
let additionalLibs = new Set(API_URLS.JQUERY.split());
if (jsLibs) {
let checkUrl = new RegExp("https?://.+$");
jsLibs
.replace(" ", "")
.split(",")
.filter(lib => checkUrl.test(lib))
.forEach(lib => additionalLibs.add(lib));
}
return additionalLibs;
}
}
let targetPlatform = targetNode.getAttribute('data-target-platform');
let jsLibs = targetNode.getAttribute('data-js-libs');
let isFoldedButton = targetNode.getAttribute('folded-button') !== "false";
targetPlatform = targetPlatform !== null ? targetPlatform : "java";
const code = targetNode.textContent.replace(/^\s+|\s+$/g, '');
const cfg = merge(defaultConfig, config);
/*
additionalLibs - setting additional JS-library
Setting JQuery as default JS library
*/
let additionalLibs;
targetNode.style.display = 'none';
targetNode.setAttribute(INITED_ATTRIBUTE_NAME, 'true');
if (targetPlatform === "js" || targetPlatform === "canvas") {
additionalLibs = new Set(API_URLS.JQUERY.split());
if (jsLibs !== null) {
let checkUrl = new RegExp("https?://.+\.js$");
jsLibs
.replace(" ", "")
.split(",")
.filter(lib => checkUrl.test(lib))
.forEach(lib => additionalLibs.add(lib));
}
}
const mountNode = document.createElement('div');
insertAfter(mountNode, targetNode);
const view = ExecutableFragment.render(mountNode, {highlightOnly});
view.update({
code: code,
compilerVersion: cfg.compilerVersion,