Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
var canLayerBeRenderedClientSide = function (layerModel) {
var cartoCSS = layerModel.get('meta').cartocss;
var result = TC.getSupportedCartoCSSResult(cartoCSS);
if (!result.supported) {
if (result.reason.indexOf('Unsupported CartoCSS') === 0) {
log.info('[Vector] Unable to render due "' + result.reason + '". Full CartoCSS:\n' + cartoCSS);
} else {
log.error(new Error('[Vector] Unable to render due "' + result.reason + '". Full CartoCSS:\n' + cartoCSS));
}
}
return result.supported;
};