Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
.reduce((children, child) => {
// If internal === true, children are an array of arrays which must be flattened.
if (isArray(child)) {
children.push.apply(children, child);
} else if (child) {
children.push(child);
}
return children;
}, []);
});
function parse(def: RangeScale) {
const range = def.range;
if (def.name === 'x' || (isArray(range) && range.find(r => isSignalRef(r) && r.signal === 'width'))) {
def.range = 'width';
} else if (def.name === 'y' || (isArray(range) && range.find(r => isSignalRef(r) && r.signal === 'height'))) {
def.range = 'height';
}
return def;
}
function parse(def: RangeScale) {
const range = def.range;
if (def.name === 'x' || (isArray(range) && range.find(r => isSignalRef(r) && r.signal === 'width'))) {
def.range = 'width';
} else if (def.name === 'y' || (isArray(range) && range.find(r => isSignalRef(r) && r.signal === 'height'))) {
def.range = 'height';
}
return def;
}