Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
}
const parentClump = this.clumpById[layoutNodeLeaf.parent ? layoutNodeLeaf.parent.id : 0]
// TODO: find out why at aggregateNode level sometimes there's a node on its own like this
if (!parentClump) continue
if (parentClump.orientation !== 'center') {
insertAtSide = this.orientationToInsertionSide[parentClump.orientation]
}
parentClump[insertAtSide](leaf.id)
const updateSide = leaf === this.leadingLeaf ? 'center' : this.insertionSideToOrientation[insertAtSide]
this.leavesOnSide[updateSide]++
}
this.order = arrayFlatten(roots.map(rootId => arrayFlatten(this.clumpById[rootId])))
}
}
.on('mouseover', () => {
const layoutNode = this.topmostUI.layout.findDataNode(frame.dataNode) || this.topmostUI.layout.rootLayoutNode
this.topmostUI.highlightNode(layoutNode, frame.dataNode)
})
.on('mouseout', () => {
this.topmostUI.highlightNode(null)
})
.on('click', () => {
this.topmostUI.queueAnimation('jumpToFrame', (animationQueue) => {
const targetUI = this.topmostUI.jumpToNode(frame.dataNode, animationQueue)
this.topmostUI.originalUI.emit('navigation', { from: this.ui, to: targetUI })
})
})
}
header += `${arrayFlatten(frame).length} frames from `
header += `${isThisNode ? 'this async operation' : `previous async operation "${frame.dataNode.name}"`}`
header += `<div class="delays">${this.getDelaysText(frame.dataNode)}`
} else if (frame.party) {
d3Group.classed(frame.party[0], true)
.classed('collapsed', frame.party[0] !== 'user')
header += `${frame.length} frame${frame.length === 1 ? '' : 's'} from ${frame.party[1]}`
}
d3SubCollapseControl.html(header)
.on('click', () => {
d3Group.classed('collapsed', !d3Group.classed('collapsed'))
})
this.drawFrames(frame, d3Group)
} else {
d3AppendTo.append('pre')</div>
function generate(handlers: Array>) {
const stack = flatten(handlers) as Middleware[];
for (const handler of stack) {
if ((typeof handler as any) !== "function") {
throw new TypeError("Handlers must be a function");
}
}
return function middleware(
err: Error | null,
req: T,
res: U,
done: Next
): V {
let index = -1;
function dispatch(pos: number, err?: Error | null): V {