MCPcopy Create free account
hub / github.com/idank/explainshell / swapNodes

Function swapNodes

explainshell/web/static/js/es.js:270–275  ·  view source on GitHub ↗
(a, b)

Source from the content-addressed store, hash-verified

268
269// swap the position of two nodes in the DOM
270function swapNodes(a, b) {
271 const aparent = a.parentNode;
272 const asibling = a.nextSibling === b ? a : a.nextSibling;
273 b.parentNode.insertBefore(a, b);
274 aparent.insertBefore(b, asibling);
275}
276
277// reorder the help <pre>'s of all links that go left
278function reorder(lefteslinks) {

Callers 1

reorderFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected