Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@anephenix/sarus

Package Overview
Dependencies
Maintainers
1
Versions
25
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@anephenix/sarus - npm Package Compare versions

Comparing version 0.2.0 to 0.2.1

.github/ISSUE_TEMPLATE/bug_report.md

36

__tests__/index/messageQueue.test.js

@@ -95,6 +95,6 @@ // File Dependencies

sarusOne.send('Hello again');
sarusOne.__proto__ = null;
sarusOne = null;
sarusOne.disconnect();
const sarusTwo = new Sarus(sarusConfig);
expect(sarusTwo.messages).toEqual(['Hello world', 'Hello again']);
return sarusTwo;
};

@@ -109,2 +109,34 @@

});
it('should process any existing messages from previous sessionStorage on initialization', async () => {
sessionStorage.clear();
const sarusTwo = retrieveMessagesFromStorage({
url,
storageType: 'session',
reconnectAutomatically: true
});
const server = new WS(url);
const messageOne = await server.nextMessage;
const messageTwo = await server.nextMessage;
expect(sarusTwo.messages).toEqual([]);
expect(messageOne).toBe('Hello world');
expect(messageTwo).toBe('Hello again');
server.close();
});
it('should process any existing messages from previous localStorage on initialization', async () => {
localStorage.clear();
const sarusTwo = retrieveMessagesFromStorage({
url,
storageType: 'local',
reconnectAutomatically: true
});
const server = new WS(url);
const messageOne = await server.nextMessage;
const messageTwo = await server.nextMessage;
expect(sarusTwo.messages).toEqual([]);
expect(messageOne).toBe('Hello world');
expect(messageTwo).toBe('Hello again');
server.close();
});
});
# CHANGELOG
### 0.2.1 - Sunday 17th March, 2019
- Fixed a bug where messages stored in persistent storage were not being popped
off of the message queue by new Sarus clients.
- Added GitHub issue templates
- Added CONTRIBUTING.md
- Added CODE_OF_CONDUCT.md
- Added some missing JSdoc code comments
### 0.2.0 - Friday 15th March, 2019

@@ -4,0 +13,0 @@

@@ -219,2 +219,3 @@ // File Dependencies

this.attachEventListeners();
if (this.messages.length > 0) this.process();
}

@@ -246,2 +247,8 @@

/**
* Disconnects the WebSocket client from the server, and changes the
* reconnectAutomatically flag to disable automatic reconnection, unless the
* developer passes a boolean flag to not do that.
* @param {boolean} overrideDisableReconnect
*/
disconnect(overrideDisableReconnect) {

@@ -332,2 +339,3 @@ const self = this;

const data = messages[0];
if (!data && messages.length === 0) return;
if (this.ws.readyState === 1) {

@@ -334,0 +342,0 @@ this.ws.send(data);

2

package.json
{
"name": "@anephenix/sarus",
"version": "0.2.0",
"version": "0.2.1",
"description": "A WebSocket JavaScript library",

@@ -5,0 +5,0 @@ "main": "index.js",

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc