New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@graffy/server

Package Overview
Dependencies
Maintainers
1
Versions
226
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@graffy/server - npm Package Compare versions

Comparing version 0.15.0-alpha.1 to 0.15.0-alpha2

22

cjs/httpServer.js
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");

@@ -8,8 +8,14 @@ exports.__esModule = true;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _concat = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/concat"));
var _asyncIterator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncIterator"));
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/esm/extends"));
var _setInterval2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-interval"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/esm/asyncToGenerator"));
var _asyncIterator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/esm/asyncIterator"));
var _url = _interopRequireDefault(require("url"));

@@ -22,6 +28,6 @@

return /*#__PURE__*/function () {
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/regeneratorRuntime.mark(function _callee(req, res) {
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(req, res) {
var parsed, query, options, keepAlive, stream, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, value, _value3, chunks, _iteratorNormalCompletion2, _didIteratorError2, _iteratorError2, _iterator2, _step2, _value2, chunk, change, _value4;
return regeneratorRuntime.wrap(function _callee$(_context) {
return _regenerator.default.wrap(function _callee$(_context) {
while (1) {

@@ -47,3 +53,3 @@ switch (_context.prev = _context.next) {

res.setHeader('content-type', 'text/event-stream');
keepAlive = setInterval(function () {
keepAlive = (0, _setInterval2.default)(function () {
if (req.aborted || res.finished) {

@@ -258,3 +264,3 @@ clearInterval(keepAlive);

case 103:
change = (0, _common.deserialize)(Buffer.concat(chunks).toString());
change = (0, _common.deserialize)((0, _concat.default)(Buffer).call(Buffer, chunks).toString());
_context.next = 106;

@@ -261,0 +267,0 @@ return store.call('write', change, options);

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");

@@ -5,0 +5,0 @@ exports.__esModule = true;

"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
var _interopRequireDefault = require("@babel/runtime-corejs3/helpers/interopRequireDefault");

@@ -8,8 +8,16 @@ exports.__esModule = true;

var _extends2 = _interopRequireDefault(require("@babel/runtime/helpers/extends"));
var _now = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/date/now"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator"));
var _forEach = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/instance/for-each"));
var _asyncIterator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncIterator"));
var _setInterval2 = _interopRequireDefault(require("@babel/runtime-corejs3/core-js-stable/set-interval"));
var _regenerator = _interopRequireDefault(require("@babel/runtime-corejs3/regenerator"));
var _extends2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/esm/extends"));
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/esm/asyncToGenerator"));
var _asyncIterator2 = _interopRequireDefault(require("@babel/runtime-corejs3/helpers/esm/asyncIterator"));
var _ws = _interopRequireDefault(require("ws"));

@@ -30,6 +38,6 @@

ws.on('message', /*#__PURE__*/function () {
var _message = (0, _asyncToGenerator2.default)( /*#__PURE__*/regeneratorRuntime.mark(function _callee(msg) {
var _message = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee(msg) {
var _deserialize, id, op, payload, options, result, stream, _iteratorNormalCompletion, _didIteratorError, _iteratorError, _iterator, _step, _value, value;
return regeneratorRuntime.wrap(function _callee$(_context) {
return _regenerator.default.wrap(function _callee$(_context) {
while (1) {

@@ -203,14 +211,16 @@ switch (_context.prev = _context.next) {

});
setInterval(function ping() {
wss.clients.forEach(function each(ws) {
(0, _setInterval2.default)(function ping() {
var _context2;
(0, _forEach.default)(_context2 = wss.clients).call(_context2, function each(ws) {
if (ws.pingPending) return ws.terminate();
ws.pingPending = true;
ws.send((0, _common.serialize)([':ping', Date.now()]));
ws.send((0, _common.serialize)([':ping', (0, _now.default)()]));
});
}, PING_INTERVAL);
return /*#__PURE__*/function () {
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(request, socket, head) {
return regeneratorRuntime.wrap(function _callee2$(_context2) {
var _ref = (0, _asyncToGenerator2.default)( /*#__PURE__*/_regenerator.default.mark(function _callee2(request, socket, head) {
return _regenerator.default.wrap(function _callee2$(_context3) {
while (1) {
switch (_context2.prev = _context2.next) {
switch (_context3.prev = _context3.next) {
case 0:

@@ -223,3 +233,3 @@ wss.handleUpgrade(request, socket, head, function done(ws) {

case "end":
return _context2.stop();
return _context3.stop();
}

@@ -226,0 +236,0 @@ }

@@ -5,3 +5,3 @@ {

"author": "aravind (https://github.com/aravindet)",
"version": "0.15.0-alpha.1",
"version": "0.15.0-alpha2",
"main": "./cjs/index.js",

@@ -16,5 +16,6 @@ "module": "./esm/index.js",

"@babel/runtime": "^7.10.4",
"@graffy/common": "0.15.0-alpha.1",
"@babel/runtime-corejs3": "^7.10.4",
"@graffy/common": "0.15.0-alpha2",
"ws": "^7.3.0"
}
}
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