Almost matching export.
This commit is contained in:
@@ -3,11 +3,11 @@ import log from "electron-log/main";
|
||||
import _ from "lodash";
|
||||
import deepLowerCaseKeys from "../../util/deepLowercaseKeys";
|
||||
import errorTypeCheck from "../../util/errorTypeCheck";
|
||||
import { DecodedStl } from "./decode-stl.interface";
|
||||
import { DecodedStl, DecodedStlLine } from "./decode-stl.interface";
|
||||
|
||||
const DecodeStl = async (
|
||||
extensionlessFilePath: string
|
||||
): Promise<DecodedStl[]> => {
|
||||
): Promise<DecodedStl> => {
|
||||
let dbf: DBFFile | null = null;
|
||||
try {
|
||||
dbf = await DBFFile.open(`${extensionlessFilePath}.STL`);
|
||||
@@ -25,8 +25,8 @@ const DecodeStl = async (
|
||||
//AD2 will always have only 1 row.
|
||||
//Commented lines have been cross referenced with existing partner fields.
|
||||
|
||||
const rawStlData: DecodedStl[] = rawDBFRecord.map((record) => {
|
||||
const singleLineData: DecodedStl = deepLowerCaseKeys(
|
||||
const rawStlData: DecodedStlLine[] = rawDBFRecord.map((record) => {
|
||||
const singleLineData: DecodedStlLine = deepLowerCaseKeys(
|
||||
_.pick(record, [
|
||||
//TODO: Add typings for EMS File Formats.
|
||||
"TTL_TYPE",
|
||||
@@ -57,6 +57,6 @@ const DecodeStl = async (
|
||||
//Apply business logic transfomrations.
|
||||
//We don't have an inspection date, we instead have `date_estimated`
|
||||
|
||||
return rawStlData;
|
||||
return { cieca_stl: rawStlData };
|
||||
};
|
||||
export default DecodeStl;
|
||||
|
||||
Reference in New Issue
Block a user