How to use the assetgraph.Image function in assetgraph

To help you get started, we’ve selected a few assetgraph 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 Munter / hyperlink / lib / index.js View on Github external
function checkCompatibility(asset, Class) {
  if (typeof Class === 'undefined') {
    Class = AssetGraph.Asset;
  } else if (typeof Class === 'string') {
    Class = AssetGraph[Class];
  }
  return (
    asset instanceof Class ||
    !asset._type ||
    Class.prototype instanceof AssetGraph[asset._type] ||
    !!(asset.isImage && Class === AssetGraph.Image) || // Svg is modelled as a subclass of Xml, not Image
    !!(asset.isImage && Class === AssetGraph.Font) // Svg can be used as a font as well
  );
}

assetgraph

An auto discovery dependency graph based optimization framework for web pages and applications

BSD-3-Clause
Latest version published 4 months ago

Package Health Score

62 / 100
Full package analysis

Similar packages