How to use the es6-set/polyfill function in es6-set

To help you get started, we’ve selected a few es6-set examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github JetBrains / kotlin-playground / src / executable-code / index.js View on Github external
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;
    }
  }
github JetBrains / kotlin-playground / src / executable-code / index.js View on Github external
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,

es6-set

ECMAScript6 Set polyfill

ISC
Latest version published 2 years ago

Package Health Score

67 / 100
Full package analysis