ff-automationv2 2.2.9 → 2.2.10

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.
@@ -3,6 +3,7 @@ export declare class ScriptDataAppender {
3
3
  private data;
4
4
  private queue;
5
5
  private errorNLP;
6
+ private taskIndex;
6
7
  private concurrencyLimit;
7
8
  add(task: () => Promise<IScriptGenerationData>): void;
8
9
  private process;
@@ -3,19 +3,21 @@ export class ScriptDataAppender {
3
3
  this.data = [];
4
4
  this.queue = [];
5
5
  this.errorNLP = "";
6
+ this.taskIndex = 0;
6
7
  this.concurrencyLimit = 5;
7
8
  }
8
9
  add(task) {
10
+ const index = this.taskIndex++;
9
11
  const job = async () => {
10
12
  await this.retry(async () => {
11
13
  const item = await task();
12
- this.process(item);
14
+ this.process(item, index);
13
15
  }, 3);
14
16
  };
15
17
  this.queue.push(job);
16
18
  }
17
- process(item) {
18
- this.data.push(item);
19
+ process(item, index) {
20
+ this.data[index] = item;
19
21
  }
20
22
  async retry(fn, retries) {
21
23
  for (let i = 0; i <= retries; i++) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "ff-automationv2",
3
- "version": "2.2.9",
3
+ "version": "2.2.10",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "description": "This lib is used to automate the manual testcase",