UNPKG

subhasmitalmg-react-spreadsheet-import

Version:

React spreadsheet import for xlsx and csv files with column matching and validation steps

18 lines (14 loc) 414 B
'use strict'; Object.defineProperty(exports, '__esModule', { value: true }); const titleMap = { checkbox: "Boolean", select: "Options", input: "Text", }; const generateExampleRow = (fields) => [ fields.reduce((acc, field) => { acc[field.key] = field.example || titleMap[field.fieldType.type]; return acc; }, {}), ]; exports.generateExampleRow = generateExampleRow;