mirror of
https://github.com/n8n-io/n8n.git
synced 2026-06-03 18:27:09 +02:00
19 lines
644 B
TypeScript
19 lines
644 B
TypeScript
import type { ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
|
|
|
|
import { getSheetHeaderRow } from '../../Google/Sheet/v2/methods/loadOptions';
|
|
export { getConditionsForColumn, getDataTableColumns } from '../../DataTable/common/methods';
|
|
|
|
export async function getSheetHeaderRowWithGeneratedColumnNames(
|
|
this: ILoadOptionsFunctions,
|
|
): Promise<INodePropertyOptions[]> {
|
|
const returnData = await getSheetHeaderRow.call(this);
|
|
return returnData.map((column, i) => {
|
|
if (column.value !== '') return column;
|
|
const indexBasedValue = `col_${i + 1}`;
|
|
return {
|
|
name: indexBasedValue,
|
|
value: indexBasedValue,
|
|
};
|
|
});
|
|
}
|