@sprucelabs/mercury-chunking-emitter 2.0.0 → 2.0.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.
|
@@ -30,6 +30,13 @@ class ChunkingEmitterImpl {
|
|
|
30
30
|
friendlyMessage: `You have to pass either 'items' or a 'batchCursor' to emit.`,
|
|
31
31
|
});
|
|
32
32
|
}
|
|
33
|
+
else if (items && cursor) {
|
|
34
|
+
throw new schema_1.SchemaError({
|
|
35
|
+
code: 'INVALID_PARAMETERS',
|
|
36
|
+
parameters: ['items', 'batchCursor'],
|
|
37
|
+
friendlyMessage: `You can only pass either 'items' or a 'batchCursor' to emit, not both.`,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
33
40
|
const match = this.emitters.find((e) => unqiueKey && e.matchesKey(unqiueKey));
|
|
34
41
|
if (match) {
|
|
35
42
|
await match.kill();
|
|
@@ -37,6 +37,13 @@ export default class ChunkingEmitterImpl {
|
|
|
37
37
|
friendlyMessage: `You have to pass either 'items' or a 'batchCursor' to emit.`,
|
|
38
38
|
});
|
|
39
39
|
}
|
|
40
|
+
else if (items && cursor) {
|
|
41
|
+
throw new SchemaError({
|
|
42
|
+
code: 'INVALID_PARAMETERS',
|
|
43
|
+
parameters: ['items', 'batchCursor'],
|
|
44
|
+
friendlyMessage: `You can only pass either 'items' or a 'batchCursor' to emit, not both.`,
|
|
45
|
+
});
|
|
46
|
+
}
|
|
40
47
|
const match = this.emitters.find((e) => unqiueKey && e.matchesKey(unqiueKey));
|
|
41
48
|
if (match) {
|
|
42
49
|
yield match.kill();
|