@whaly/connector-sdk 0.3.1 → 0.3.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +6 -4
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +6 -4
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -2305,10 +2305,10 @@ var extractSingleSheetRows = async (fileName, conf) => {
|
|
|
2305
2305
|
if (!variables) {
|
|
2306
2306
|
throw new Error(`No variables extracted from filename, cannot extract derived field ${key}`);
|
|
2307
2307
|
}
|
|
2308
|
-
acc[key] = variables[column.variableName] ||
|
|
2308
|
+
acc[key] = variables[column.variableName] || null;
|
|
2309
2309
|
} else {
|
|
2310
2310
|
const colIndex = excelColumnToIndex(column.column);
|
|
2311
|
-
acc[key] = row[colIndex]?.v ||
|
|
2311
|
+
acc[key] = row[colIndex]?.v || null;
|
|
2312
2312
|
}
|
|
2313
2313
|
return acc;
|
|
2314
2314
|
}, {});
|
|
@@ -2533,7 +2533,8 @@ async function* rowGeneratorFromCsv(path2, fileConfig) {
|
|
|
2533
2533
|
for (const key of configKeys) {
|
|
2534
2534
|
const keyGenerator = fileConfig.fields[key.trim()];
|
|
2535
2535
|
if (!keyGenerator) continue;
|
|
2536
|
-
|
|
2536
|
+
const rawValue = keyGenerator.valueTransformer ? keyGenerator.valueTransformer(row[key]) : row[key];
|
|
2537
|
+
rowData[keyGenerator.key] = rawValue === "" ? null : rawValue;
|
|
2537
2538
|
}
|
|
2538
2539
|
yield rowData;
|
|
2539
2540
|
} else {
|
|
@@ -2542,7 +2543,8 @@ async function* rowGeneratorFromCsv(path2, fileConfig) {
|
|
|
2542
2543
|
for (let i = 0; i < rowKeys.length; i++) {
|
|
2543
2544
|
const keyGenerator = fileConfig.fields[i];
|
|
2544
2545
|
if (!keyGenerator) continue;
|
|
2545
|
-
|
|
2546
|
+
const rawValue = keyGenerator.valueTransformer ? keyGenerator.valueTransformer(row[i]) : row[i];
|
|
2547
|
+
rowData[keyGenerator.key] = rawValue === "" ? null : rawValue;
|
|
2546
2548
|
}
|
|
2547
2549
|
yield rowData;
|
|
2548
2550
|
}
|