Initial
This commit is contained in:
17
resources/app/node_modules/@smithy/eventstream-codec/dist-es/MessageEncoderStream.js
generated
vendored
Normal file
17
resources/app/node_modules/@smithy/eventstream-codec/dist-es/MessageEncoderStream.js
generated
vendored
Normal file
@@ -0,0 +1,17 @@
|
||||
export class MessageEncoderStream {
|
||||
constructor(options) {
|
||||
this.options = options;
|
||||
}
|
||||
[Symbol.asyncIterator]() {
|
||||
return this.asyncIterator();
|
||||
}
|
||||
async *asyncIterator() {
|
||||
for await (const msg of this.options.messageStream) {
|
||||
const encoded = this.options.encoder.encode(msg);
|
||||
yield encoded;
|
||||
}
|
||||
if (this.options.includeEndFrame) {
|
||||
yield new Uint8Array(0);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user