Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// generate better layer name from node classes
layer.setName(buildLayerNameFromBEM(node.classList));
return layer;
});
})
.reduce((prev, current) => prev.concat(current), [])
.filter(layer => layer !== null)
.forEach(layer => symbol.addLayer(layer));
if (symbol._name.startsWith('ColorMask/')) {
maskColors.push(symbol);
}
if (symbol._name.startsWith('Button/')) {
symbol.setGroupLayout(SMART_LAYOUT.HORIZONTALLY_CENTER);
}
if (symbol._name.startsWith('Counter/')) {
symbol.setGroupLayout(SMART_LAYOUT.HORIZONTALLY_CENTER);
}
if (symbol._name.startsWith('Icon/')) {
/* eslint-disable no-unused-vars */
const [, type, size] = symbol._name.split('/');
/* eslint-enable no-unused-vars */
const layerSize = parseInt(size, 10);
const mask = maskColors[0];
const maskSymbolInstance = mask.getSymbolInstance(
{x: symbol._x, y: symbol._y, width: layerSize, height: layerSize}
);