import { ApolloColumnType } from '../interfaces'; export const findColumn = (columns: Array>, key: string) => { return columns.find(item => { if (item.key) { return String(item.key) === key; } if (Array.isArray(item.dataIndex)) { return String(item.dataIndex[item.dataIndex.length - 1]) === key; } else { return String(item.dataIndex) === key; } }) as ApolloColumnType; };