Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
addedWindowIds.forEach((windowId, i) => {
const path = this.pathToCorner();
const parent = this.pathToParent(path);
const destination = this.nodeAtPath(path);
const direction = parent ? getOtherDirection(parent.direction) : 'row';
let first;
let second;
if (direction === 'row') {
first = destination;
second = addedWindowIds[i];
} else {
first = addedWindowIds[i];
second = destination;
}
const update = {
path,
spec: {
$set: {
direction,
first,
second,