src/utilities/Duplicator.js
function Duplicator() {

    this.duplicateComponent = function(component) {
        const visitor = new DuplicatingVisitor();
        component.acceptVisitor(visitor);
        return visitor.result;
    };

    return this;
}
function Duplicator() {

    this.duplicateComponent = function(component) {
        const visitor = new DuplicatingVisitor();
        component.acceptVisitor(visitor);
        return visitor.result;
    };

    return this;
}
function Duplicator ( ) { this . duplicateComponent = function ( component ) { const visitor = new DuplicatingVisitor ( ) ; component . acceptVisitor ( visitor ) ; return visitor . result ; } ; return this ; }
PUBLIC CONSTRUCTORS 
This class implements a duplicator that uses a visitor to create a deep copy of a
component. Since elements are immutable, they are not copied, only referenced.

@constructor
@returns {Duplicator} The new component duplicator.
PUBLIC CONSTRUCTORS This class implements a duplicator that uses a visitor to create a deep copy of a component . Since elements are immutable they are not copied only referenced .