🚀 Socket Launch Week Day 5:Introducing Repository Access Permissions and Custom Roles.Learn more
Sign In

@byelabel/utils

Package Overview
Dependencies
Maintainers
1
Versions
43
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@byelabel/utils - npm Package Compare versions

Comparing version
2.3.0
to
2.3.1
+6
-6
build/utils/rabbit.js

@@ -447,8 +447,8 @@ "use strict";

if (callback && (0, validator_1.isFunction)(callback)) {
const _d = yield callback(params), { events, stream } = _d, result = __rest(_d, ["events", "stream"]);
const _d = yield callback(params), { events } = _d, result = __rest(_d, ["events"]);
if ((_b = message.properties) === null || _b === void 0 ? void 0 : _b.replyTo) {
const correlationId = (_c = message.properties) === null || _c === void 0 ? void 0 : _c.correlationId;
// streaming reply: pipe a Readable straight into the chunk protocol
if (stream && (0, validator_1.isFunction)(stream.pipe)) {
yield sendReadableStream(message.properties.replyTo, stream, {
// streaming reply: payload itself is a Readable — pipe it straight into the chunk protocol
if (result.payload && (0, validator_1.isFunction)(result.payload.pipe)) {
yield sendReadableStream(message.properties.replyTo, result.payload, {
replyTo: message.properties.replyTo,

@@ -799,4 +799,4 @@ correlationId,

return new Promise((resolve) => {
events_1.default.emit(name, params.data, (error, payload, events, stream) => {
resolve({ error, payload, events, stream });
events_1.default.emit(name, params.data, (error, payload, events) => {
resolve({ error, payload, events });
});

@@ -803,0 +803,0 @@ });

{
"name": "@byelabel/utils",
"version": "2.3.0",
"version": "2.3.1",
"description": "ByeLabel Utilities",

@@ -5,0 +5,0 @@ "type": "commonjs",

@@ -349,8 +349,8 @@ # @byelabel/utils

await rabbit.receiveMessage('file', async (params) => {
return { stream: fs.createReadStream(`/storage/${params.id}.pdf`) };
return { payload: fs.createReadStream(`/storage/${params.id}.pdf`) };
});
// via the eventEmitter (the reply callback's 4th arg is the stream)
// via the eventEmitter — payload can be a regular value or a Readable
eventEmitter.on('file.download', (params, reply) => {
reply(null, null, undefined, fs.createReadStream(`/storage/${params.id}.pdf`));
reply(null, fs.createReadStream(`/storage/${params.id}.pdf`));
});

@@ -357,0 +357,0 @@