1
0
mirror of https://github.com/sasjs/adapter.git synced 2026-01-09 05:20:05 +00:00

feat(nullVars): add SAS null vars support

This commit is contained in:
Yury Shkoda
2022-01-05 16:54:16 +03:00
parent 84ed3e7d03
commit fbce35b272
5 changed files with 163 additions and 52 deletions

View File

@@ -7,9 +7,17 @@ export const formatDataForRequest = (data: any) => {
const result: any = {}
for (const tableName in data) {
if (
tableName.match(/^\$.*/) &&
Object.keys(data).includes(tableName.replace(/^\$/, ''))
) {
continue
}
tableCounter++
sasjsTables.push(tableName)
const csv = convertToCSV(data[tableName])
const csv = convertToCSV(data[tableName], data[`$${tableName}`])
if (csv === 'ERROR: LARGE STRING LENGTH') {
throw new Error(
'The max length of a string value in SASjs is 32765 characters.'
@@ -27,6 +35,7 @@ export const formatDataForRequest = (data: any) => {
result[`sasjs${tableCounter}data`] = csv
}
}
result['sasjs_tables'] = sasjsTables.join(' ')
return result