Comparing version 0.1.2 to 0.1.3-dependabot-npm-and-yarn-acorn-7-1-1.ab8c76b.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.2", | ||
"version": "0.1.3-dependabot-npm-and-yarn-acorn-7-1-1.ab8c76b.0", | ||
"description": "An undersized, opinionated, RabbitMQ library for common messaging patterns in Nodejs.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
@@ -1,2 +0,2 @@ | ||
# fiver · [![npm](https://img.shields.io/npm/v/npm.svg?style=flat-square)](https://www.npmjs.com/package/npm) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/flitbit/fiver/blob/master/LICENSE) | ||
# fiver · [![CircleCI](https://circleci.com/gh/flitbit/fiver.svg?style=svg)](https://circleci.com/gh/flitbit/fiver) [![npm](https://img.shields.io/npm/v/npm.svg?style=flat-square)](https://www.npmjs.com/package/npm) [![PRs Welcome](https://img.shields.io/badge/PRs-welcome-brightgreen.svg?style=flat-square)](http://makeapullrequest.com) [![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg?style=flat-square)](https://github.com/flitbit/fiver/blob/master/LICENSE) | ||
> A runt of a RabbitMQ client | ||
@@ -3,0 +3,0 @@ |
@@ -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
169823
3225