import { isLeafNode, traverseColumn } from '../utils';
import { warnTransformsDeprecated } from './warnTransformsDeprecated';
/** @deprecated transform 用法已经过时，请使用 pipeline 来对表格进行拓展 */
export function makeFlattenTransform() {
  warnTransformsDeprecated('makeFlattenTransform');
  return traverseColumn(function (column) {
    var _a;
    if (isLeafNode(column)) {
      return column;
    }
    return ((_a = column.features) === null || _a === void 0 ? void 0 : _a.flatten) ? column.children : column;
  });
}