function makeSelectionUndoData(obj, undoDatumMaker) {
  let undoData;

  if (obj.type === 'activeSelection') {
    undoData = obj.getObjects().map((item) => {
      const { angle, left, top, scaleX, scaleY, width, height } = item;

      fabric.util.addTransformToObject(item, obj.calcTransformMatrix());
      const result = undoDatumMaker(item);

      item.set({
        angle,
        left,
        top,
        width,
        height,
        scaleX,
        scaleY,
      });

      return result;
    });
  } else {
    undoData = [undoDatumMaker(obj)];
  }

  return undoData;
}
Make undo data
@param {fabric.Object} obj - selection object
@param {Function} undoDatumMaker - make undo datum
@returns {Array} undoData
@private