Skip to content

Commit

Permalink
chore: code tidying
Browse files Browse the repository at this point in the history
  • Loading branch information
chrismclarke committed Sep 25, 2024
1 parent 1db2371 commit 2959c96
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,10 @@ class BaseProcessor<T = any, V = any> {
constructor(public context: { namespace: string; paths: IConverterPaths; cacheVersion: number }) {
const { namespace } = context;
this.logger = createChildFileLogger({ source: namespace });
this.setupCache();
// HACK - support tests by avoiding setup if folderPath not provided
if (context.paths) {
this.setupCache();
}
}
/**
* Create a namespaced cache folder and populate a list of all files currently cached,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,10 +64,8 @@ export class FlowParserProcessor extends BaseProcessor<FlowTypes.FlowTypeWithDat

public updateProcessedFlowHashmap(flow: FlowTypes.FlowTypeWithData) {
const { flow_name, flow_type, _xlsxPath } = flow;
if (!this.processedFlowHashmap[flow_type]) {
this.processedFlowHashmap[flow_type] = {};
this.processedFlowHashmapWithMeta[flow_type] = {};
}
this.processedFlowHashmap[flow_type] ??= {};
this.processedFlowHashmapWithMeta[flow_type] ??= {};
// NOTE - duplicate flows are identified up during main converter
this.processedFlowHashmap[flow_type][flow_name] = flow.rows;
this.processedFlowHashmapWithMeta[flow_type][flow_name] = flow;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,6 @@ export class DataPipeParser extends DefaultParser<FlowTypes.DataPipeFlow> {
}

private populateGeneratedFlows(outputs: { [output_name: string]: any[] }) {
this.flowProcessor.processedFlowHashmap.data_list ??= {};

for (const [flow_name, rows] of Object.entries(outputs)) {
const flow: FlowTypes.FlowTypeWithData = {
flow_name,
Expand Down

0 comments on commit 2959c96

Please sign in to comment.