@sprucelabs/mercury-chunking-emitter 1.4.0 → 1.4.1

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.
@@ -12,7 +12,7 @@ export default class ChunkingEmitterImpl {
12
12
  emit(options: ChunkingEmitterEmitOptions): Promise<void>;
13
13
  private emitChunk;
14
14
  static reset(): void;
15
- private splitItemsIntoChunks;
15
+ private Cursor;
16
16
  getTotalErrors(): number;
17
17
  }
18
18
  interface ChunkingEmitterOptions {
@@ -34,9 +34,9 @@ class ChunkingEmitterImpl {
34
34
  });
35
35
  }
36
36
  this.totalErrors = 0;
37
- let actualCursor = cursor !== null && cursor !== void 0 ? cursor : this.splitItemsIntoChunks(items !== null && items !== void 0 ? items : []);
38
- const total = await actualCursor.getTotalRecords();
39
37
  let current = 0;
38
+ let actualCursor = cursor !== null && cursor !== void 0 ? cursor : this.Cursor(items !== null && items !== void 0 ? items : []);
39
+ const total = await actualCursor.getTotalRecords();
40
40
  try {
41
41
  for (var _d = true, actualCursor_1 = __asyncValues(actualCursor), actualCursor_1_1; actualCursor_1_1 = await actualCursor_1.next(), _a = actualCursor_1_1.done, !_a; _d = true) {
42
42
  _c = actualCursor_1_1.value;
@@ -87,7 +87,7 @@ class ChunkingEmitterImpl {
87
87
  static reset() {
88
88
  this.Class = undefined;
89
89
  }
90
- splitItemsIntoChunks(items) {
90
+ Cursor(items) {
91
91
  const cursor = new data_stores_1.BatchArrayCursor(items, { batchSize: this.chunkSize });
92
92
  return cursor;
93
93
  }
@@ -12,7 +12,7 @@ export default class ChunkingEmitterImpl {
12
12
  emit(options: ChunkingEmitterEmitOptions): Promise<void>;
13
13
  private emitChunk;
14
14
  static reset(): void;
15
- private splitItemsIntoChunks;
15
+ private Cursor;
16
16
  getTotalErrors(): number;
17
17
  }
18
18
  interface ChunkingEmitterOptions {
@@ -44,9 +44,9 @@ export default class ChunkingEmitterImpl {
44
44
  });
45
45
  }
46
46
  this.totalErrors = 0;
47
- let actualCursor = cursor !== null && cursor !== void 0 ? cursor : this.splitItemsIntoChunks(items !== null && items !== void 0 ? items : []);
48
- const total = yield actualCursor.getTotalRecords();
49
47
  let current = 0;
48
+ let actualCursor = cursor !== null && cursor !== void 0 ? cursor : this.Cursor(items !== null && items !== void 0 ? items : []);
49
+ const total = yield actualCursor.getTotalRecords();
50
50
  try {
51
51
  for (var _d = true, actualCursor_1 = __asyncValues(actualCursor), actualCursor_1_1; actualCursor_1_1 = yield actualCursor_1.next(), _a = actualCursor_1_1.done, !_a; _d = true) {
52
52
  _c = actualCursor_1_1.value;
@@ -100,7 +100,7 @@ export default class ChunkingEmitterImpl {
100
100
  static reset() {
101
101
  this.Class = undefined;
102
102
  }
103
- splitItemsIntoChunks(items) {
103
+ Cursor(items) {
104
104
  const cursor = new BatchArrayCursor(items, { batchSize: this.chunkSize });
105
105
  return cursor;
106
106
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sprucelabs/mercury-chunking-emitter",
3
- "version": "1.4.0",
3
+ "version": "1.4.1",
4
4
  "files": [
5
5
  "build/**/*",
6
6
  "!build/__tests__",