MCPcopy Create free account
hub / github.com/Marus/cortex-debug / moveDownChild

Method moveDownChild

src/frontend/views/live-watch.ts:142–161  ·  view source on GitHub ↗
(node: LiveVariableNode)

Source from the content-addressed store, hash-verified

140 }
141
142 public moveDownChild(node: LiveVariableNode): boolean {
143 if (!node || !node.isRootChild()) { return false; }
144 let ix = 0;
145 const last = this.children ? this.children.length - 1 : -1;
146 for (const child of this.children || []) {
147 if (child.name === node.name) {
148 if (ix !== last) {
149 const next = this.children[ix + 1];
150 this.children[ix] = next;
151 this.children[ix + 1] = child;
152 } else {
153 const last = this.children.pop();
154 this.children.unshift(last);
155 }
156 return true;
157 }
158 ix++;
159 }
160 return false;
161 }
162
163 public reset(valuesToo = true) {
164 this.session = undefined;

Callers 1

moveDownNodeMethod · 0.80

Calls 1

isRootChildMethod · 0.80

Tested by

no test coverage detected