All files / src/storages/control-flow ControlFlowStorage.ts

100% Statements 10/10
100% Branches 0/0
100% Functions 2/2
100% Lines 8/8
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26    1x   1x   223x   223x             214x   360x 360x   360x          
import { ICustomNode } from '../../interfaces/custom-nodes/ICustomNode';
 
import { MapStorage } from '../MapStorage';
 
export class ControlFlowStorage extends MapStorage <ICustomNode> {
    constructor () {
        super();
 
        this.initialize();
    }
 
    /**
     * @returns {string}
     */
    public toString (): string {
        return Array
            .from(this.storage)
            .reduce((controlFlowStorageItems: string[], [key, value]: [string, ICustomNode]) => {
                controlFlowStorageItems.push(`${key}: ${value.getCode()}`);
 
                return controlFlowStorageItems;
            }, [])
            .join(',');
    }
}