import _extends from "@babel/runtime-corejs3/helpers/extends";
import _Set from "@babel/runtime-corejs3/core-js-stable/set";
import { isLeafNode, traverseColumn } from '../utils';
import { warnTransformsDeprecated } from './warnTransformsDeprecated';
/** @deprecated transform 用法已经过时，请使用 pipeline 来对表格进行拓展 */
export function makeVisibleTransform(visibleCodes) {
  warnTransformsDeprecated('makeVisibleTransform');
  var set = new _Set(visibleCodes);
  return traverseColumn(function (column) {
    if (!isLeafNode(column)) {
      return column;
    }
    return set.has(column.code) ? column : _extends(_extends({}, column), {
      hidden: true
    });
  });
}