mirror of
https://github.com/sasjs/adapter.git
synced 2026-01-18 09:30:06 +00:00
fix(special-missings): fix convertToCSV format object
This commit is contained in:
@@ -5,8 +5,11 @@ export const generateFileUploadForm = (
|
|||||||
data: any
|
data: any
|
||||||
): FormData => {
|
): FormData => {
|
||||||
for (const tableName in data) {
|
for (const tableName in data) {
|
||||||
|
if (!Array.isArray(data[tableName])) continue
|
||||||
|
|
||||||
const name = tableName
|
const name = tableName
|
||||||
const csv = convertToCSV(data[tableName])
|
const csv = convertToCSV(data[tableName])
|
||||||
|
|
||||||
if (csv === 'ERROR: LARGE STRING LENGTH') {
|
if (csv === 'ERROR: LARGE STRING LENGTH') {
|
||||||
throw new Error(
|
throw new Error(
|
||||||
'The max length of a string value in SASjs is 32765 characters.'
|
'The max length of a string value in SASjs is 32765 characters.'
|
||||||
|
|||||||
@@ -3,7 +3,7 @@
|
|||||||
* @param data - the array of JSON objects to convert.
|
* @param data - the array of JSON objects to convert.
|
||||||
*/
|
*/
|
||||||
export const convertToCSV = (
|
export const convertToCSV = (
|
||||||
data: any,
|
data: Array<any>,
|
||||||
sasFormats?: { formats: { [key: string]: string } }
|
sasFormats?: { formats: { [key: string]: string } }
|
||||||
) => {
|
) => {
|
||||||
let formats = sasFormats?.formats
|
let formats = sasFormats?.formats
|
||||||
@@ -76,7 +76,7 @@ export const convertToCSV = (
|
|||||||
return byteSize
|
return byteSize
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.sort((a: number, b: number) => b - a)[0]
|
.sort((a: any, b: any) => b - a)[0]
|
||||||
|
|
||||||
if (longestValueForField && longestValueForField > 32765) {
|
if (longestValueForField && longestValueForField > 32765) {
|
||||||
invalidString = true
|
invalidString = true
|
||||||
|
|||||||
Reference in New Issue
Block a user