@lokalise/background-jobs-common
Advanced tools
Comparing version 2.0.1 to 2.0.2
@@ -13,5 +13,7 @@ import type { JobFinalState, SafeJob } from '../../types'; | ||
* Adds a job processing result and resolves any promises waiting for a matching job in the given final state. | ||
* Note: This method is not exposed on BackgroundJobProcessorSpyInterface, it is intended to be | ||
* Note: This method is not exposed on {@link BackgroundJobProcessorSpyInterface}, it is intended to be | ||
* a private package method | ||
* | ||
* JobData is cloned, to be protected against purge after the job is completed. | ||
* | ||
* @param job - The job to be added or updated. | ||
@@ -18,0 +20,0 @@ * @param state - Final state of the job. |
@@ -44,5 +44,7 @@ "use strict"; | ||
* Adds a job processing result and resolves any promises waiting for a matching job in the given final state. | ||
* Note: This method is not exposed on BackgroundJobProcessorSpyInterface, it is intended to be | ||
* Note: This method is not exposed on {@link BackgroundJobProcessorSpyInterface}, it is intended to be | ||
* a private package method | ||
* | ||
* JobData is cloned, to be protected against purge after the job is completed. | ||
* | ||
* @param job - The job to be added or updated. | ||
@@ -55,3 +57,4 @@ * @param state - Final state of the job. | ||
return; | ||
this.jobProcessingResults.set(job.id, { job, state }); | ||
const clonedJobData = (0, node_core_1.deepClone)(job.data); | ||
this.jobProcessingResults.set(job.id, { job: { ...job, data: clonedJobData }, state }); | ||
if (this.promises.length === 0) | ||
@@ -58,0 +61,0 @@ return; |
{ | ||
"name": "@lokalise/background-jobs-common", | ||
"version": "2.0.1", | ||
"version": "2.0.2", | ||
"files": [ | ||
@@ -5,0 +5,0 @@ "dist", |
47980
728