* Execute the provided action.
(actionObj: ParsedAction)
| 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. |
no test coverage detected