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

django-channels

Package Overview
Dependencies
Maintainers
2
Versions
18
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

django-channels - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

2

dist/index.js

@@ -8,4 +8,4 @@ parcelRequire=function(e,r,t,n){var i,o="function"==typeof parcelRequire&&parcelRequire,u="function"==typeof require&&require;function f(t,n){if(!r[t]){if(!e[t]){var i="function"==typeof parcelRequire&&parcelRequire;if(!n&&i)return i(t,!0);if(o)return o(t,!0);if(u&&"string"==typeof t)return u(t);var c=new Error("Cannot find module '"+t+"'");throw c.code="MODULE_NOT_FOUND",c}p.resolve=function(r){return e[t][1][r]||r},p.cache={};var l=r[t]=new f.Module(t);e[t][0].call(l.exports,p,l,l.exports,this)}return r[t].exports;function p(e){return f(p.resolve(e))}}f.isParcelRequire=!0,f.Module=function(e){this.id=e,this.bundle=f,this.exports={}},f.modules=e,f.cache=r,f.parent=o,f.register=function(r,t){e[r]=[function(e,r){r.exports=t},{}]};for(var c=0;c<t.length;c++)try{f(t[c])}catch(e){i||(i=e)}if(t.length){var l=f(t[t.length-1]);"object"==typeof exports&&"undefined"!=typeof module?module.exports=l:"function"==typeof define&&define.amd?define(function(){return l}):n&&(this[n]=l)}if(parcelRequire=f,i)throw i;return f}({"QVnC":[function(require,module,exports) {

},{}],"Focm":[function(require,module,exports) {
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WebSocketBridge=exports.Stream=void 0,require("regenerator-runtime/runtime");var e=require("event-target-shim"),t=n(require("reconnecting-websocket"));function n(e){return e&&e.__esModule?e:{default:e}}function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function a(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?o(n,!0).forEach(function(t){s(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):o(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function s(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function i(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function l(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?p(e):t}function f(e){return(f=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function d(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&y(e,t)}function y(e,t){return(y=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var b=function(t){function n(e,t){var r;return i(this,n),(r=l(this,f(n).call(this))).name=e,r.socket=t,r.cb=null,r.handleMessage=r.handleMessage.bind(p(r)),r.socket.addEventListener("message",r.handleMessage),r}return d(n,e.EventTarget),u(n,[{key:"handleMessage",value:function(e){var t=JSON.parse(e.data);if(t.stream===this.name){var n=new MessageEvent("message",{data:t.payload,origin:this.name});this.dispatchEvent(n)}}},{key:"send",value:function(e){var t={stream:this.name,payload:e};this.socket.send(JSON.stringify(t))}}]),n}();exports.Stream=b;var h=function(n){function r(e){var t;return i(this,r),(t=l(this,f(r).call(this))).socket=null,t.streams={},t.streamCallbacks={},t.default_cb=null,t.options=a({},e),t.handleMessage=t.handleMessage.bind(p(t)),t}return d(r,e.EventTarget),u(r,[{key:"connect",value:function(e,n,r){var o,a="https:"===window.location.protocol?"wss":"ws",s="".concat(a,"://").concat(window.location.host);window.location.port&&(s+=":".concat(window.location.port)),o=void 0===e?s:"/"==e[0]?"".concat(s).concat(e):e,this.socket=new t.default(o,n,r),this.socket.addEventListener("message",this.handleMessage)}},{key:"handleMessage",value:function(e){var t=JSON.parse(e.data);if(void 0===t.stream){var n=new MessageEvent("message",{data:t,origin:""});this.dispatchEvent(n)}}},{key:"demultiplex",value:function(e,t){this.stream(e).addEventListener("message",t)}},{key:"send",value:function(e){this.socket.send(JSON.stringify(e))}},{key:"stream",value:function(e){var t;return void 0!==this.streams[e]?t=this.streams[e]:(t=new b(e,this.socket),this.streams[e]=t),t}}]),r}();exports.WebSocketBridge=h;
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.WebSocketBridge=exports.Stream=void 0,require("regenerator-runtime/runtime");var e=require("event-target-shim"),t=n(require("reconnecting-websocket"));function n(e){return e&&e.__esModule?e:{default:e}}function r(e,t){var n=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);t&&(r=r.filter(function(t){return Object.getOwnPropertyDescriptor(e,t).enumerable})),n.push.apply(n,r)}return n}function o(e){for(var t=1;t<arguments.length;t++){var n=null!=arguments[t]?arguments[t]:{};t%2?r(n,!0).forEach(function(t){i(e,t,n[t])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(n)):r(n).forEach(function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(n,t))})}return e}function i(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}function s(e){return(s="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function u(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function f(e,t){return!t||"object"!==s(t)&&"function"!=typeof t?p(e):t}function d(e){return(d=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function p(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&v(e,t)}function v(e,t){return(v=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var y=function(t){function n(){var e;return a(this,n),(e=f(this,d(n).call(this))).forwardEvent=e.forwardEvent.bind(p(e)),e}return l(n,e.EventTarget),u(n,[{key:"forwardEvent",value:function(e){this.dispatchEvent(e)}}]),n}(),h=function(e){function t(e,n){var r;return a(this,t),(r=f(this,d(t).call(this))).name=e,r.socket=n,r.handleMessage=r.handleMessage.bind(p(r)),r.socket.addEventListener("message",r.handleMessage),r.socket.addEventListener("open",r.forwardEvent),r.socket.addEventListener("close",r.forwardEvent),r.socket.addEventListener("error",r.forwardEvent),r}return l(t,y),u(t,[{key:"handleMessage",value:function(e){var t=JSON.parse(e.data);if(t.stream===this.name){var n=new MessageEvent("message",{data:t.payload,origin:this.name});this.dispatchEvent(n)}}},{key:"send",value:function(e){var t={stream:this.name,payload:e};this.socket.send(JSON.stringify(t))}}]),t}();exports.Stream=h,(0,e.defineEventAttribute)(h.prototype,"open"),(0,e.defineEventAttribute)(h.prototype,"close"),(0,e.defineEventAttribute)(h.prototype,"error"),(0,e.defineEventAttribute)(h.prototype,"message");var b=function(e){function n(e){var t;return a(this,n),(t=f(this,d(n).call(this))).socket=null,t.streams={},t.options=o({},e),t.handleMessage=t.handleMessage.bind(p(t)),t}return l(n,y),u(n,[{key:"connect",value:function(e,n,r){var o,i="https:"===window.location.protocol?"wss":"ws",s="".concat(i,"://").concat(window.location.host);window.location.port&&(s+=":".concat(window.location.port)),o=void 0===e?s:"/"==e[0]?"".concat(s).concat(e):e,this.socket=new t.default(o,n,r),this.socket.addEventListener("open",this.forwardEvent),this.socket.addEventListener("close",this.forwardEvent),this.socket.addEventListener("error",this.forwardEvent),this.socket.addEventListener("message",this.handleMessage)}},{key:"handleMessage",value:function(e){var t=JSON.parse(e.data);if(void 0===t.stream){var n=new MessageEvent("message",{data:t,origin:""});this.dispatchEvent(n)}}},{key:"demultiplex",value:function(e,t){this.stream(e).addEventListener("message",t)}},{key:"send",value:function(e){this.socket.send(JSON.stringify(e))}},{key:"stream",value:function(e){var t;return void 0!==this.streams[e]?t=this.streams[e]:(t=new h(e,this.socket),this.streams[e]=t),t}}]),n}();exports.WebSocketBridge=b,(0,e.defineEventAttribute)(b.prototype,"open"),(0,e.defineEventAttribute)(b.prototype,"close"),(0,e.defineEventAttribute)(b.prototype,"error"),(0,e.defineEventAttribute)(b.prototype,"message");
},{"regenerator-runtime/runtime":"QVnC","event-target-shim":"w7m6","reconnecting-websocket":"Oeha"}]},{},["Focm"], null)
//# sourceMappingURL=/index.js.map
{
"name": "django-channels",
"version": "2.0.0",
"version": "2.1.0",
"description": "",

@@ -5,0 +5,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

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