feat: rm spread op to reduce time complexity
This commit is contained in:
@@ -374,23 +374,17 @@ export class WorkflowInterpreter {
|
|||||||
scrapeSchemaOutput: Object.keys(mergedScrapeSchema).length > 0
|
scrapeSchemaOutput: Object.keys(mergedScrapeSchema).length > 0
|
||||||
? { "schema_merged": [mergedScrapeSchema] }
|
? { "schema_merged": [mergedScrapeSchema] }
|
||||||
: this.serializableDataByType.scrapeSchema.reduce((reducedObject, item, index) => {
|
: this.serializableDataByType.scrapeSchema.reduce((reducedObject, item, index) => {
|
||||||
return {
|
reducedObject[`schema_${index}`] = item;
|
||||||
[`schema_${index}`]: item,
|
return reducedObject;
|
||||||
...reducedObject,
|
}, {} as Record<string, any>),
|
||||||
}
|
|
||||||
}, {}),
|
|
||||||
scrapeListOutput: this.serializableDataByType.scrapeList.reduce((reducedObject, item, index) => {
|
scrapeListOutput: this.serializableDataByType.scrapeList.reduce((reducedObject, item, index) => {
|
||||||
return {
|
reducedObject[`list_${index}`] = item;
|
||||||
[`list_${index}`]: item,
|
return reducedObject;
|
||||||
...reducedObject,
|
}, {} as Record<string, any>),
|
||||||
}
|
|
||||||
}, {}),
|
|
||||||
binaryOutput: this.binaryData.reduce((reducedObject, item, index) => {
|
binaryOutput: this.binaryData.reduce((reducedObject, item, index) => {
|
||||||
return {
|
reducedObject[`item_${index}`] = item;
|
||||||
[`item_${index}`]: item,
|
return reducedObject;
|
||||||
...reducedObject,
|
}, {} as Record<string, any>)
|
||||||
}
|
|
||||||
}, {})
|
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.log('debug', `Interpretation finished`);
|
logger.log('debug', `Interpretation finished`);
|
||||||
|
|||||||
Reference in New Issue
Block a user