How to use the core-js-compat/modules.slice function in core-js-compat

To help you get started, we’ve selected a few core-js-compat 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 zloirock / core-js / packages / core-js-builder / index.js View on Github external
module.exports = async function ({ blacklist = [], modules = modulesList.slice(), targets, filename } = {}) {
  const set = new Set();

  function filter(method, list) {
    for (const ns of list) {
      for (const name of modulesList) {
        if (name === ns || name.startsWith(`${ ns }.`)) {
          set[method](name);
        }
      }
    }
  }

  filter('add', modules);
  filter('delete', blacklist);

  modules = modulesList.filter(it => set.has(it));

core-js-compat

core-js compat

MIT
Latest version published 9 days ago

Package Health Score

94 / 100
Full package analysis