keep dummy sections
This commit is contained in:
parent
a2760971b9
commit
afeb36253c
|
@ -350,9 +350,10 @@ async function exportToFile(e) {
|
||||||
/** Stripping `sections`, `null` and empty objects */
|
/** Stripping `sections`, `null` and empty objects */
|
||||||
function cleanupStyle(style) {
|
function cleanupStyle(style) {
|
||||||
const copy = {};
|
const copy = {};
|
||||||
for (const [key, val] of Object.entries(style)) {
|
for (let [key, val] of Object.entries(style)) {
|
||||||
if (key === 'sections'
|
if (key === 'sections'
|
||||||
? !style.usercssData
|
// Keeping dummy `sections` for compatibility with older Stylus
|
||||||
|
? !style.usercssData || (val = [{code: ''}])
|
||||||
: typeof val !== 'object' || !isEmptyObj(val)) {
|
: typeof val !== 'object' || !isEmptyObj(val)) {
|
||||||
copy[key] = val;
|
copy[key] = val;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user