How to use the mnemonist/set.difference function in mnemonist

To help you get started, we’ve selected a few mnemonist 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 medialab / website / api / cleanup.js View on Github external
if (href)
          usedAssets.add(href);
      });

      $('img, iframe[data-internal=true]').each(function() {
        const src = $(this).attr('src');

        if (src)
          usedAssets.add(src);
      });
    });
  });

  const allAssets = new Set(fs.readdirSync(assetsPath));
  const unusedAssets = difference(allAssets, usedAssets);
  const missingAssets = difference(usedAssets, allAssets);

  if (missingAssets.size)
    console.warning('Missing assets!', missingAssets);

  return unusedAssets;
};
github medialab / website / api / cleanup.js View on Github external
if (href)
          usedAssets.add(href);
      });

      $('img, iframe[data-internal=true]').each(function() {
        const src = $(this).attr('src');

        if (src)
          usedAssets.add(src);
      });
    });
  });

  const allAssets = new Set(fs.readdirSync(assetsPath));
  const unusedAssets = difference(allAssets, usedAssets);
  const missingAssets = difference(usedAssets, allAssets);

  if (missingAssets.size)
    console.warning('Missing assets!', missingAssets);

  return unusedAssets;
};

mnemonist

Curated collection of data structures for the JavaScript/TypeScript.

MIT
Latest version published 10 months ago

Package Health Score

76 / 100
Full package analysis