rpc-websockets
Advanced tools
Comparing version 7.4.17 to 7.4.18
@@ -88,3 +88,3 @@ /** | ||
*/ | ||
notify(method: string, params?: IWSRequestParams): Promise<unknown>; | ||
notify(method: string, params?: IWSRequestParams): Promise<void>; | ||
/** | ||
@@ -91,0 +91,0 @@ * Subscribes for a defined event. |
@@ -20,3 +20,2 @@ /** | ||
import { EventEmitter } from "eventemitter3"; | ||
import CircularJSON from "circular-json"; | ||
export default class CommonClient extends EventEmitter { | ||
@@ -199,3 +198,3 @@ /** | ||
try { | ||
message = CircularJSON.parse(message); | ||
message = JSON.parse(message); | ||
} | ||
@@ -202,0 +201,0 @@ catch (error) { |
@@ -185,3 +185,3 @@ /** | ||
*/ | ||
close(): Promise<unknown>; | ||
close(): Promise<void>; | ||
/** | ||
@@ -188,0 +188,0 @@ * Handles all WebSocket JSON RPC 2.0 requests. |
@@ -11,3 +11,2 @@ /** | ||
import url from "url"; | ||
import CircularJSON from "circular-json"; | ||
import * as utils from "./utils"; | ||
@@ -185,3 +184,3 @@ export default class Server extends EventEmitter { | ||
continue; | ||
socket.send(CircularJSON.stringify({ | ||
socket.send(JSON.stringify({ | ||
notification: name, | ||
@@ -242,3 +241,3 @@ params: params || null | ||
for (let i = 0, id; id = socket_ids[i]; ++i) { | ||
self.namespaces[name].clients.get(id).send(CircularJSON.stringify({ | ||
self.namespaces[name].clients.get(id).send(JSON.stringify({ | ||
notification: event, | ||
@@ -367,3 +366,3 @@ params: params || [] | ||
return; | ||
return socket.send(CircularJSON.stringify(responses), msg_options); | ||
return socket.send(JSON.stringify(responses), msg_options); | ||
} | ||
@@ -373,3 +372,3 @@ const response = await this._runMethod(parsedData, socket._id, ns); | ||
return; | ||
return socket.send(CircularJSON.stringify(response), msg_options); | ||
return socket.send(JSON.stringify(response), msg_options); | ||
}); | ||
@@ -376,0 +375,0 @@ } |
@@ -10,2 +10,4 @@ "use strict"; | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
@@ -25,3 +27,3 @@ | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
@@ -56,5 +58,5 @@ var Client = /*#__PURE__*/function (_CommonClient) { | ||
return Client; | ||
return (0, _createClass2["default"])(Client); | ||
}(_client["default"]); | ||
exports.Client = Client; |
@@ -8,2 +8,3 @@ "use strict"; | ||
}); | ||
exports.Client = void 0; | ||
Object.defineProperty(exports, "Server", { | ||
@@ -15,4 +16,5 @@ enumerable: true, | ||
}); | ||
exports.Client = void 0; | ||
var _createClass2 = _interopRequireDefault(require("@babel/runtime/helpers/createClass")); | ||
var _classCallCheck2 = _interopRequireDefault(require("@babel/runtime/helpers/classCallCheck")); | ||
@@ -34,3 +36,3 @@ | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
@@ -81,5 +83,5 @@ var __rest = void 0 && (void 0).__rest || function (s, e) { | ||
return Client; | ||
return (0, _createClass2["default"])(Client); | ||
}(_client["default"]); | ||
exports.Client = Client; |
@@ -88,3 +88,3 @@ /** | ||
*/ | ||
notify(method: string, params?: IWSRequestParams): Promise<unknown>; | ||
notify(method: string, params?: IWSRequestParams): Promise<void>; | ||
/** | ||
@@ -91,0 +91,0 @@ * Subscribes for a defined event. |
@@ -33,7 +33,5 @@ /** | ||
var _circularJson = _interopRequireDefault(require("circular-json")); | ||
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = (0, _getPrototypeOf2["default"])(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = (0, _getPrototypeOf2["default"])(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return (0, _possibleConstructorReturn2["default"])(this, result); }; } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
@@ -422,3 +420,3 @@ var __rest = void 0 && (void 0).__rest || function (s, e) { | ||
try { | ||
message = _circularJson["default"].parse(message); | ||
message = JSON.parse(message); | ||
} catch (error) { | ||
@@ -425,0 +423,0 @@ return; |
@@ -28,3 +28,3 @@ /** | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
@@ -31,0 +31,0 @@ var WebSocketBrowserImpl = /*#__PURE__*/function (_EventEmitter) { |
@@ -185,3 +185,3 @@ /** | ||
*/ | ||
close(): Promise<unknown>; | ||
close(): Promise<void>; | ||
/** | ||
@@ -188,0 +188,0 @@ * Handles all WebSocket JSON RPC 2.0 requests. |
@@ -7,6 +7,6 @@ /** | ||
var _interopRequireWildcard = require("@babel/runtime/helpers/interopRequireWildcard"); | ||
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault"); | ||
var _typeof3 = require("@babel/runtime/helpers/typeof"); | ||
Object.defineProperty(exports, "__esModule", { | ||
@@ -17,6 +17,6 @@ value: true | ||
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); | ||
var _typeof2 = _interopRequireDefault(require("@babel/runtime/helpers/typeof")); | ||
var _regenerator = _interopRequireDefault(require("@babel/runtime/regenerator")); | ||
var _asyncToGenerator2 = _interopRequireDefault(require("@babel/runtime/helpers/asyncToGenerator")); | ||
@@ -46,8 +46,10 @@ | ||
var _circularJson = _interopRequireDefault(require("circular-json")); | ||
var utils = _interopRequireWildcard(require("./utils")); | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === "undefined" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } | ||
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); } | ||
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof3(obj) !== "object" && typeof obj !== "function") { return { "default": obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj["default"] = obj; if (cache) { cache.set(obj, newObj); } return newObj; } | ||
function _createForOfIteratorHelper(o, allowArrayLike) { var it = typeof Symbol !== "undefined" && o[Symbol.iterator] || o["@@iterator"]; if (!it) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === "number") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = it.call(o); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it["return"] != null) it["return"](); } finally { if (didErr) throw err; } } }; } | ||
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); } | ||
@@ -59,3 +61,3 @@ | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } } | ||
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } } | ||
@@ -315,3 +317,3 @@ var Server = /*#__PURE__*/function (_EventEmitter) { | ||
if (!socket) continue; | ||
socket.send(_circularJson["default"].stringify({ | ||
socket.send(JSON.stringify({ | ||
notification: name, | ||
@@ -385,3 +387,3 @@ params: params || null | ||
for (var i = 0, id; id = socket_ids[i]; ++i) { | ||
self.namespaces[name].clients.get(id).send(_circularJson["default"].stringify({ | ||
self.namespaces[name].clients.get(id).send(JSON.stringify({ | ||
notification: event, | ||
@@ -612,3 +614,3 @@ params: params || [] | ||
case 38: | ||
return _context.abrupt("return", socket.send(_circularJson["default"].stringify(responses), msg_options)); | ||
return _context.abrupt("return", socket.send(JSON.stringify(responses), msg_options)); | ||
@@ -630,3 +632,3 @@ case 39: | ||
case 44: | ||
return _context.abrupt("return", socket.send(_circularJson["default"].stringify(response), msg_options)); | ||
return _context.abrupt("return", socket.send(JSON.stringify(response), msg_options)); | ||
@@ -633,0 +635,0 @@ case 45: |
{ | ||
"name": "rpc-websockets", | ||
"version": "7.4.17", | ||
"version": "7.4.18", | ||
"description": "JSON-RPC 2.0 implementation over WebSockets for Node.js", | ||
@@ -20,7 +20,6 @@ "main": "./dist/index.js", | ||
"dependencies": { | ||
"@babel/runtime": "^7.11.2", | ||
"circular-json": "^0.5.9", | ||
"@babel/runtime": "^7.17.2", | ||
"eventemitter3": "^4.0.7", | ||
"uuid": "^8.3.0", | ||
"ws": "^7.4.5" | ||
"uuid": "^8.3.2", | ||
"ws": "^8.5.0" | ||
}, | ||
@@ -32,20 +31,20 @@ "optionalDependencies": { | ||
"devDependencies": { | ||
"@babel/cli": "^7.11.6", | ||
"@babel/core": "^7.11.6", | ||
"@babel/plugin-transform-runtime": "^7.11.5", | ||
"@babel/preset-env": "^7.11.5", | ||
"@babel/preset-typescript": "^7.10.4", | ||
"@types/uuid": "^8.3.0", | ||
"@types/ws": "^7.2.6", | ||
"@typescript-eslint/eslint-plugin": "^4.0.1", | ||
"@typescript-eslint/parser": "^4.0.1", | ||
"@babel/cli": "^7.17.0", | ||
"@babel/core": "^7.17.2", | ||
"@babel/plugin-transform-runtime": "^7.17.0", | ||
"@babel/preset-env": "^7.16.11", | ||
"@babel/preset-typescript": "^7.16.7", | ||
"@types/uuid": "^8.3.4", | ||
"@types/ws": "^8.2.2", | ||
"@typescript-eslint/eslint-plugin": "^5.11.0", | ||
"@typescript-eslint/parser": "^5.11.0", | ||
"babel-eslint": "^10.1.0", | ||
"browserify": "^16.5.2", | ||
"chai": "^4.2.0", | ||
"coveralls": "^3.1.0", | ||
"eslint": "^7.8.1", | ||
"browserify": "^17.0.0", | ||
"chai": "^4.3.6", | ||
"coveralls": "^3.1.1", | ||
"eslint": "^8.8.0", | ||
"istanbul": "^0.4.5", | ||
"mocha": "^8.1.3", | ||
"mocha": "^9.2.0", | ||
"mocha-lcov-reporter": "^1.3.0", | ||
"typescript": "^4.0.2" | ||
"typescript": "^4.5.5" | ||
}, | ||
@@ -52,0 +51,0 @@ "browser": "./dist/index.browser.js", |
Sorry, the diff of this file is too big to display
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
6
5444638
6697
+ Addedws@8.18.0(transitive)
- Removedcircular-json@^0.5.9
- Removedcircular-json@0.5.9(transitive)
- Removedws@7.5.10(transitive)
Updated@babel/runtime@^7.17.2
Updateduuid@^8.3.2
Updatedws@^8.5.0