MCPcopy Create free account
hub / github.com/Monogatari/Monogatari / executeAction

Method executeAction

src/components/type-writer/index.ts:1042–1053  ·  view source on GitHub ↗

* Execute the provided action.

(actionObj: ParsedAction)

Source from the content-addressed store, hash-verified

1040 * Execute the provided action.
1041 */
1042 executeAction(actionObj: ParsedAction): void {
1043 const actions = (this.constructor as typeof TypeWriter).actions();
1044
1045 for (const key in actions) {
1046 if (actionObj.action === key) {
1047 const { action: _, ...rest } = actionObj;
1048 const variables = Object.values(rest);
1049
1050 actions[key].action.apply(this, variables);
1051 }
1052 }
1053 }
1054
1055 /**
1056 * Adjust the received speed and return it with some randomization.

Callers 2

typewriteMethod · 0.95
_revealNextCharacterMethod · 0.95

Calls 2

actionsMethod · 0.45
applyMethod · 0.45

Tested by

no test coverage detected