correctly strip 'code' from style hash

This commit is contained in:
tophf 2018-01-10 21:54:59 +03:00
parent 9fdabe3582
commit 650cf3521b

View File

@ -249,9 +249,9 @@ function filterStyles({
if (!omitCode) return styles;
if (!asHash) return styles.map(getStyleWithNoCode);
for (const id in styles) {
const style = styles[id];
if (style && style.sections) {
styles[id] = getStyleWithNoCode(style);
const sections = styles[id];
if (Array.isArray(sections)) {
styles[id] = getStyleWithNoCode({sections}).sections;
}
}
return styles;