import { sheets_v4 } from "googleapis" ; type Schema$RowData = sheets_v4 . Schema$RowData ; type Schema$CellData = sheets_v4 . Schema$CellData ; export const createRow = ( rowData ) : Schema$RowData [ ] => { return rowData . map ( ( line ) => { return { values : line . map ( ( cellValue ) => { return createCell ( cellValue ) ; } ) } ; } ) ; } ; example param cell export const createCell = ( cell ) : Schema$CellData => { if ( typeof cell === "number" ) { return { userEnteredFormat : { numberFormat : { type : "CURRENCY" } } , userEnteredValue : { numberValue : cell } } ; } if ( cell . startsWith ( "=" ) ) { return { userEnteredFormat : { numberFormat : { type : "CURRENCY" } } , userEnteredValue : { formulaValue : cell } } ; } return { userEnteredValue : { stringValue : String ( cell ) } } ; } ;