MCPcopy Create free account
hub / github.com/sql-js/sql.js / nodeStream

Function nodeStream

documentation/javascript/application.js:203–228  ·  view source on GitHub ↗
(node)

Source from the content-addressed store, hash-verified

201 /* Stream merging */
202
203 function nodeStream(node) {
204 var result = [];
205 (function (node, offset) {
206 for (var i = 0; i < node.childNodes.length; i++) {
207 if (node.childNodes[i].nodeType == 3)
208 offset += node.childNodes[i].nodeValue.length;
209 else if (node.childNodes[i].nodeName == 'BR')
210 offset += 1;
211 else if (node.childNodes[i].nodeType == 1) {
212 result.push({
213 event: 'start',
214 offset: offset,
215 node: node.childNodes[i]
216 });
217 offset = arguments.callee(node.childNodes[i], offset);
218 result.push({
219 event: 'stop',
220 offset: offset,
221 node: node.childNodes[i]
222 });
223 }
224 }
225 return offset;
226 })(node, 0);
227 return result;
228 }
229
230 function mergeStreams(stream1, stream2, value) {
231 var processed = 0;

Callers 1

highlightBlockFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…