rascal 20.1.1 → 21.0.0

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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Change Log
2
2
 
3
+ ## 21.0.0
4
+ - **BREAKING**: Drop Node.js 14 support (EOL since April 2023). Minimum Node.js version is now 16.
5
+
6
+ ## 20.1.2
7
+ - Remove codeclimate (it's been sold) until we have time to replace get it working again.
8
+
3
9
  ## 20.1.1
4
10
  - npm search algorithm has changed. Updating metadata accordingly.
5
11
 
package/README.md CHANGED
@@ -5,10 +5,6 @@ Rascal is an advanced RabbitMQ / AMQP client built on [amqplib](https://www.npmj
5
5
  [![NPM version](https://img.shields.io/npm/v/rascal.svg?style=flat-square)](https://www.npmjs.com/package/rascal)
6
6
  [![NPM downloads](https://img.shields.io/npm/dm/rascal.svg?style=flat-square)](https://www.npmjs.com/package/rascal)
7
7
  [![Node.js CI](https://github.com/onebeyond/rascal/workflows/Node.js%20CI/badge.svg)](https://github.com/onebeyond/rascal/actions?query=workflow%3A%22Node.js+CI%22)
8
- [![Code Climate](https://codeclimate.com/github/onebeyond/rascal/badges/gpa.svg)](https://codeclimate.com/github/onebeyond/rascal)
9
- [![Test Coverage](https://codeclimate.com/github/onebeyond/rascal/badges/coverage.svg)](https://codeclimate.com/github/onebeyond/rascal/coverage)
10
- [![rascal](https://snyk.io/advisor/npm-package/rascal/badge.svg)](https://snyk.io/advisor/npm-package/rascal)
11
- [![Discover zUnit](https://img.shields.io/badge/Discover-zUnit-brightgreen)](https://www.npmjs.com/package/zunit)
12
8
 
13
9
  ## About
14
10
 
@@ -4,17 +4,16 @@ var config = require('./config');
4
4
  Rascal.Broker.create(Rascal.withDefaultConfig(config), function (err, broker) {
5
5
  if (err) throw err;
6
6
 
7
- broker
8
- .subscribe('demo_sub', function (err, subscription) {
9
- if (err) throw err;
10
- subscription
11
- .on('message', function (message, content, ackOrNack) {
12
- console.log(content);
13
- ackOrNack();
14
- })
15
- .on('error', console.error);
16
- })
17
- .on('error', console.error);
7
+ broker.subscribe('demo_sub', function (err, subscription) {
8
+ if (err) throw err;
9
+ subscription
10
+ .on('message', function (message, content, ackOrNack) {
11
+ console.log(content);
12
+ ackOrNack();
13
+ })
14
+ .on('error', console.error);
15
+ });
16
+ broker.on('error', console.error);
18
17
 
19
18
  setInterval(function () {
20
19
  broker.publish('demo_pub', new Date().toISOString() + ': hello world', 'demo_q', function (err, publication) {
@@ -1,18 +1,11 @@
1
- const get = require('lodash').get;
2
-
3
- module.exports = function (options) {
4
- const min = get(options, 'min', 1000);
5
- const max = get(options, 'max', min);
1
+ module.exports = function (options = {}) {
2
+ const min = options.min || 1000;
3
+ const max = options.max || min;
4
+ const range = max - min;
6
5
 
7
6
  function next() {
8
- return Math.floor(Math.random() * (max - min + 1) + min);
7
+ return range === 0 ? min : Math.floor(Math.random() * (range + 1) + min);
9
8
  }
10
9
 
11
- // eslint-disable-next-line no-empty-function
12
- function reset() {}
13
-
14
- return {
15
- next,
16
- reset,
17
- };
10
+ return { next, reset: () => {} };
18
11
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "rascal",
3
- "version": "20.1.1",
3
+ "version": "21.0.0",
4
4
  "description": "An advanced RabbitMQ / AMQP client built on amqplib",
5
5
  "main": "index.js",
6
6
  "dependencies": {