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

Method setActionScript

src/validator.js:116–128  ·  view source on GitHub ↗
(actionScript)

Source from the content-addressed store, hash-verified

114 }
115
116 setActionScript(actionScript) {
117 if (!this.actionScripts) {
118 this.actionScripts = [actionScript];
119 } else {
120 this.actionScripts = this.actionScripts.push(actionScript);
121 }
122
123 const names = this.actionScripts.map((script) => script.name);
124 this.namesSet = new Set(names);
125 if (this.namesSet.size !== names.length) {
126 throw new Error("All action scripts must have a unique name");
127 }
128 }
129
130 setActionScripts(actionScripts) {
131 if (!this.actionScripts) {

Calls

no outgoing calls

Tested by

no test coverage detected