"use strict";

Object.defineProperty(exports, "__esModule", {
  value: true
});
exports.makeFlattenTransform = makeFlattenTransform;

var _utils = require("../utils");

var _warnTransformsDeprecated = require("./warnTransformsDeprecated");

/** @deprecated transform 用法已经过时，请使用 pipeline 来对表格进行拓展 */
function makeFlattenTransform() {
  (0, _warnTransformsDeprecated.warnTransformsDeprecated)('makeFlattenTransform');
  return (0, _utils.traverseColumn)(function (column) {
    var _a;

    if ((0, _utils.isLeafNode)(column)) {
      return column;
    }

    return ((_a = column.features) === null || _a === void 0 ? void 0 : _a.flatten) ? column.children : column;
  });
}