MCPcopy Create free account
hub / github.com/dharmaprotocol/dharmaOS / flatten

Method flatten

src/encoder.js:563–574  ·  view source on GitHub ↗
(actions)

Source from the content-addressed store, hash-verified

561 }
562
563 flatten(actions) {
564 const flatActions = [];
565 for (const action of actions) {
566 if (typeof action === 'object' && 'if' in action) {
567 const conditionalActions = this.determineConditionalActions(action);
568 flatActions.push(...this.flatten(conditionalActions));
569 } else {
570 flatActions.push(action);
571 }
572 }
573 return flatActions;
574 }
575
576 constructCallAndResultFormat(action) {
577 if (typeof action === 'object' && 'raw' in action) {

Callers 1

Calls 1

Tested by

no test coverage detected