MCPcopy Create free account
hub / github.com/KoboldAI/KoboldAI-Client / buildChunkSetFromNodeArray

Function buildChunkSetFromNodeArray

static/application.js:1775–1788  ·  view source on GitHub ↗
(nodes)

Source from the content-addressed store, hash-verified

1773}
1774
1775function buildChunkSetFromNodeArray(nodes) {
1776 var set = new Set();
1777 for(var i = 0; i < nodes.length; i++) {
1778 node = nodes[i];
1779 while(node !== null && node.tagName !== "CHUNK") {
1780 node = node.parentNode;
1781 }
1782 if(node === null) {
1783 continue;
1784 }
1785 set.add(node.getAttribute("n"));
1786 }
1787 return set;
1788}
1789
1790function getSelectedNodes() {
1791 var range = rangy.getSelection().getRangeAt(0); // rangy is not a typo

Callers 4

chunkOnBeforeInputFunction · 0.85
applyChunkDeltasFunction · 0.85
syncAllModifiedChunksFunction · 0.85
highlightEditingChunksFunction · 0.85

Calls 1

addMethod · 0.45

Tested by

no test coverage detected