MCPcopy Index your code
hub / github.com/Moddable-OpenSource/moddable / onResult

Method onResult

tools/xsbug-log/xsbug-debugmachine.js:531–556  ·  view source on GitHub ↗
(items, data)

Source from the content-addressed store, hash-verified

529 }
530
531 onResult(items, data) {
532 let result;
533 if (items.length === 0) {
534 result = data;
535 }
536 else {
537 const prop = items[0];
538 if (!prop.children || prop.children.length === 0)
539 result = prop.value;
540 else {
541 let parts = [];
542 for (const child of prop.children) {
543 if (child.name && child.name !== "(..)")
544 parts.push(`${child.name}: ${child.value}`);
545 if (parts.length > 20) {
546 parts.push("…");
547 break;
548 }
549 }
550 result = "{ " + parts.join(", ") + " }";
551 }
552 }
553 this.clearLine();
554 console.log(result);
555 this.showPrompt();
556 }
557
558 onBroken(path, line, text) {
559 // Auto-continue for non-interactive connections (e.g., mcsim)

Callers

nothing calls this directly

Calls 4

clearLineMethod · 0.95
showPromptMethod · 0.95
logMethod · 0.65
pushMethod · 0.45

Tested by

no test coverage detected