ControlFlowStorage.ts 587 B

12345678910111213141516171819
  1. import { ICustomNode } from '../../interfaces/custom-nodes/ICustomNode';
  2. import { MapStorage } from '../MapStorage';
  3. export class ControlFlowStorage extends MapStorage <ICustomNode> {
  4. /**
  5. * @returns {string}
  6. */
  7. public toString (): string {
  8. return Array
  9. .from(this.storage)
  10. .reduce((controlFlowStorageItems: string[], [key, value]: [string, ICustomNode]) => {
  11. controlFlowStorageItems.push(`${key}: ${value.getCode()}`);
  12. return controlFlowStorageItems;
  13. }, [])
  14. .join(',');
  15. }
  16. }