Comparing version 0.1.3-master.4239318.0 to 0.1.3-master.16d7eab.0
@@ -9,3 +9,10 @@ import { PublishOp } from './common'; | ||
static publisherCrc32(op: PublishOp): PublishOp; | ||
/** | ||
* Ensures that the message's options indicate the message should be treated | ||
* persistent by the broker. | ||
* | ||
* @param op the incoming op | ||
*/ | ||
static persistentMessages(op: PublishOp): PublishOp; | ||
} | ||
export {}; |
@@ -86,4 +86,25 @@ "use strict"; | ||
} | ||
/** | ||
* Ensures that the message's options indicate the message should be treated | ||
* persistent by the broker. | ||
* | ||
* @param op the incoming op | ||
*/ | ||
static persistentMessages(op) { | ||
const { destinations, content, options } = op; | ||
if (options && options.persistent) { | ||
return { | ||
destinations, | ||
content, | ||
options, | ||
}; | ||
} | ||
return { | ||
destinations, | ||
content, | ||
options: Object.assign(options || {}, { persistent: true }), | ||
}; | ||
} | ||
} | ||
exports.PublisherMiddleware = PublisherMiddleware; | ||
//# sourceMappingURL=publisher-middleware.js.map |
{ | ||
"name": "fiver", | ||
"version": "0.1.3-master.4239318.0", | ||
"version": "0.1.3-master.16d7eab.0", | ||
"description": "An undersized, opinionated, RabbitMQ library for common messaging patterns in Nodejs.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -90,2 +90,24 @@ import { gzipSync, deflateSync } from 'zlib'; | ||
} | ||
/** | ||
* Ensures that the message's options indicate the message should be treated | ||
* persistent by the broker. | ||
* | ||
* @param op the incoming op | ||
*/ | ||
static persistentMessages(op: PublishOp): PublishOp { | ||
const { destinations, content, options } = op; | ||
if (options && options.persistent) { | ||
return { | ||
destinations, | ||
content, | ||
options, | ||
}; | ||
} | ||
return { | ||
destinations, | ||
content, | ||
options: Object.assign(options || {}, { persistent: true }), | ||
}; | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
169794
3225