Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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
);
}
key =>
AssetGraph[key] &&
AssetGraph[key].prototype &&
AssetGraph[key].prototype.findOutgoingRelationsInParseTree ===
AssetGraph.Asset.prototype.findOutgoingRelationsInParseTree
);