cloneLayer = (name, hrService) => {
  // Clone the current layer and make the cloned layer the new current layer
  const newLayer = svgCanvas
    .getCurrentDrawing()
    .cloneLayer(name, historyRecordingService(hrService))

  svgCanvas.clearSelection()
  leaveContext()
  svgCanvas.call('changed', [newLayer])
}
Creates a new top-level layer in the drawing with the given name, copies all the current layer's contents
to it, and then clears the selection. This function then calls the 'changed' handler.
This is an undoable action.
@function module:draw.cloneLayer
@param {string} name - The given name. If the layer name exists, a new name will be generated.
@param {module:history.HistoryRecordingService} hrService - History recording service
@fires module:svgcanvas.SvgCanvas#event:changed
@returns {void}