Only split properties accross targets if there are targets

This commit is contained in:
Stefan Zermatten
2021-02-22 14:30:50 +02:00
parent 12939c46de
commit 612fcca68c

View File

@@ -62,7 +62,7 @@ function applyPropertyAndWalkChildren({prop, child, targets, ...options}){
export default function applyProperties({ forest, targets, ...options}){
forest.forEach(child => {
let prop = child.node;
if (shouldSplit(prop)){
if (shouldSplit(prop) && targets.length){
targets.forEach(target => {
let targets = [target]
applyPropertyAndWalkChildren({ targets, prop, child, ...options});