Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
// $ExpectType [string, [PropType, PropData]] || Property
getProperties(ast[1])[0];
// $ExpectType [string, [PropType, PropData]][] || Property[]
getPropertiesByType(["h1", [], []], "variable");
// $ExpectType Node[] || AST
removeNodesByName(ast, "h1");
// $ExpectType Node
setProperty(ast[0], "prop", 9);
// $ExpectType Node
setProperties(ast[1], { prop1: ["expression", "x"], prop2: 3 });
// $ExpectType Node
removeProperty(ast[0], "prop1");
child = setProperty(child, 'className', ['value', 'fullWidth ' + className[1]]);
break;
case 'expression':
child = setProperty(child, 'className', ['expression', `"fullWidth " + (${className[1]})`]);
break;
case 'variable':
child = setProperty(child, 'className', ['expression', `"fullWidth " + (${className[1]})`]);
break;
default:
child = setProperty(child, 'className', ['value', 'fullWidth']);
}
} else {
child = setProperty(child, 'className', ['value', 'fullWidth']);
}
} else {
child = removeProperty(child, 'fullWidth');
}
if (currentTextContainer.length) {
acc = acc.concat([['TextContainer', [], currentTextContainer], child]);
} else {
acc = acc.concat([child]);
}
currentTextContainer = [];
} else {
currentTextContainer.push(child);
}
return acc;
}, []);