Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// eslint-disable-next-line max-len
if (symbol._name.startsWith('Button/') && layer instanceof SVG || symbol._name.startsWith('Label/') && layer instanceof SVG) {
const type = node.children[0].id;
const size = node.clientHeight;
const icon = icons.find(icon => icon.type === type);
layer = icon.symbol.getSymbolInstance({
x: layer._x,
y: layer._y,
width: size,
// eslint-disable-next-line comma-dangle
height: size
});
// eslint-disable-next-line max-len
layer.setResizingConstraint(RESIZING_CONSTRAINTS.HEIGHT, RESIZING_CONSTRAINTS.WIDTH, RESIZING_CONSTRAINTS.LEFT);
}
if (layer instanceof SVG && node.classList.contains('sg-icon') && !symbol._name.startsWith('Icon/')) {
const type = node.children[0].id;
const color = getComputedStyle(node).fill;
const size = node.clientHeight;
const icon = icons.find(icon => icon.type === type && icon.size === size);
if (icon) {
layer = icon.symbol.getSymbolInstance({x: layer._x, y: layer._y, width: size, height: size});
// CONSTRAINTS FOR ICON IN LIST
if (node.parentElement.classList.contains('sg-list__icon')) {
layer.setResizingConstraint(
RESIZING_CONSTRAINTS.WIDTH,
RESIZING_CONSTRAINTS.HEIGHT,