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

@textile/grpc-transport

Package Overview
Dependencies
Maintainers
5
Versions
20
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@textile/grpc-transport - npm Package Compare versions

Comparing version 0.5.1 to 0.5.2

8

dist/cjs/index.js

@@ -34,6 +34,12 @@ "use strict";

}
else if (url.startsWith('wss://')) {
return url;
}
else if (url.substr(0, 7) === 'http://') {
return `ws://${url.substr(7)}`;
}
throw new Error('Websocket transport constructed with non-https:// or http:// host.');
else if (url.startsWith('ws://')) {
return url;
}
throw new Error('Websocket transport constructed with non-{http,ws}[s]:// host.');
}

@@ -40,0 +46,0 @@ function headersToBytes(headers) {

2

dist/esm/index.js

@@ -1,1 +0,1 @@

var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var o=null;"undefined"!=typeof WebSocket?o=WebSocket:"undefined"!=typeof MozWebSocket?o=MozWebSocket:void 0!==e?o=e.WebSocket||e.MozWebSocket:"undefined"!=typeof window?o=window.WebSocket||window.MozWebSocket:"undefined"!=typeof self&&(o=self.WebSocket||self.MozWebSocket);var n,t=o,r=(function(o){var n,t;n=e,t=function(){var e=function(){},o="undefined",n=typeof window!==o&&typeof window.navigator!==o&&/Trident\/|MSIE /.test(window.navigator.userAgent),t=["trace","debug","info","warn","error"];function r(e,o){var n=e[o];if("function"==typeof n.bind)return n.bind(e);try{return Function.prototype.bind.call(n,e)}catch(o){return function(){return Function.prototype.apply.apply(n,[e,arguments])}}}function i(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(t){return"debug"===t&&(t="log"),typeof console!==o&&("trace"===t&&n?i:void 0!==console[t]?r(console,t):void 0!==console.log?r(console,"log"):e)}function c(o,n){for(var r=0;r<t.length;r++){var i=t[r];this[i]=r<o?e:this.methodFactory(i,o,n)}this.log=this.debug}function s(e,n,t){return function(){typeof console!==o&&(c.call(this,n,t),this[e].apply(this,arguments))}}function u(e,o,n){return l(e)||s.apply(this,arguments)}function a(e,n,r){var i,l=this,s="loglevel";function a(){var e;if(typeof window!==o&&s){try{e=window.localStorage[s]}catch(e){}if(typeof e===o)try{var n=window.document.cookie,t=n.indexOf(encodeURIComponent(s)+"=");-1!==t&&(e=/^([^;]+)/.exec(n.slice(t))[1])}catch(e){}return void 0===l.levels[e]&&(e=void 0),e}}"string"==typeof e?s+=":"+e:"symbol"==typeof e&&(s=void 0),l.name=e,l.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},l.methodFactory=r||u,l.getLevel=function(){return i},l.setLevel=function(n,r){if("string"==typeof n&&void 0!==l.levels[n.toUpperCase()]&&(n=l.levels[n.toUpperCase()]),!("number"==typeof n&&n>=0&&n<=l.levels.SILENT))throw"log.setLevel() called with invalid level: "+n;if(i=n,!1!==r&&function(e){var n=(t[e]||"silent").toUpperCase();if(typeof window!==o&&s){try{return void(window.localStorage[s]=n)}catch(e){}try{window.document.cookie=encodeURIComponent(s)+"="+n+";"}catch(e){}}}(n),c.call(l,n,e),typeof console===o&&n<l.levels.SILENT)return"No console available for logging"},l.setDefaultLevel=function(e){a()||l.setLevel(e,!1)},l.enableAll=function(e){l.setLevel(l.levels.TRACE,e)},l.disableAll=function(e){l.setLevel(l.levels.SILENT,e)};var f=a();null==f&&(f=null==n?"WARN":n),l.setLevel(f,!1)}var f=new a,d={};f.getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var o=d[e];return o||(o=d[e]=new a(e,f.getLevel(),f.methodFactory)),o};var p=typeof window!==o?window.log:void 0;return f.noConflict=function(){return typeof window!==o&&window.log===f&&(window.log=p),f},f.getLoggers=function(){return d},f.default=f,f},o.exports?o.exports=t():n.log=t()}(n={exports:{}},n.exports),n.exports);const{debug:i}=r.getLogger("grpc-transport");var l;!function(e){e[e.FINISH_SEND=1]="FINISH_SEND"}(l||(l={}));const c=new Uint8Array([1]);function s(e){let o="";return e.forEach(((e,n)=>{o+=`${e}: ${n.join(", ")}\r\n`})),function(e){const o=new Uint8Array(e.length);for(let r=0;r!==e.length;++r){const i=e.charCodeAt(r);if(t=void 0,!(9===(t=n=i)||10===t||13===t||n>=32&&n<=126))throw new Error("Metadata contains invalid ASCII");o[r]=i}var n,t;return o}(o)}function u(e){e.debug&&i("websocketRequest",e);const o=function(e){if("https://"===e.substr(0,8))return`wss://${e.substr(8)}`;if("http://"===e.substr(0,7))return`ws://${e.substr(7)}`;throw new Error("Websocket transport constructed with non-https:// or http:// host.")}(e.url),n=[];let r;function u(e){if(e===l.FINISH_SEND)r.send(c);else{const o=e,n=new Int8Array(o.byteLength+1);n.set(new Uint8Array([0])),n.set(o,1),r.send(n)}}return{sendMessage:e=>{r&&r.readyState!==r.CONNECTING?u(e):n.push(e)},finishSend:()=>{r&&r.readyState!==r.CONNECTING?u(l.FINISH_SEND):n.push(l.FINISH_SEND)},start:l=>{r=new t(o,["grpc-websockets"]),r.binaryType="arraybuffer",r.onopen=function(){e.debug&&i("websocketRequest.onopen"),r.send(s(l)),n.forEach((e=>{u(e)}))},r.onclose=function(o){e.debug&&i("websocketRequest.onclose",o),e.onEnd()},r.onerror=function(o){e.debug&&i("websocketRequest.onerror",o)},r.onmessage=function(o){e.onChunk(new Uint8Array(o.data))}},cancel:()=>{e.debug&&i("websocket.abort"),r.close()}}}function a(){return e=>u(e)}export{a as WebsocketTransport};
var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};var o=null;"undefined"!=typeof WebSocket?o=WebSocket:"undefined"!=typeof MozWebSocket?o=MozWebSocket:void 0!==e?o=e.WebSocket||e.MozWebSocket:"undefined"!=typeof window?o=window.WebSocket||window.MozWebSocket:"undefined"!=typeof self&&(o=self.WebSocket||self.MozWebSocket);var t,n=o,r=(function(o){var t,n;t=e,n=function(){var e=function(){},o="undefined",t=typeof window!==o&&typeof window.navigator!==o&&/Trident\/|MSIE /.test(window.navigator.userAgent),n=["trace","debug","info","warn","error"];function r(e,o){var t=e[o];if("function"==typeof t.bind)return t.bind(e);try{return Function.prototype.bind.call(t,e)}catch(o){return function(){return Function.prototype.apply.apply(t,[e,arguments])}}}function i(){console.log&&(console.log.apply?console.log.apply(console,arguments):Function.prototype.apply.apply(console.log,[console,arguments])),console.trace&&console.trace()}function l(n){return"debug"===n&&(n="log"),typeof console!==o&&("trace"===n&&t?i:void 0!==console[n]?r(console,n):void 0!==console.log?r(console,"log"):e)}function s(o,t){for(var r=0;r<n.length;r++){var i=n[r];this[i]=r<o?e:this.methodFactory(i,o,t)}this.log=this.debug}function c(e,t,n){return function(){typeof console!==o&&(s.call(this,t,n),this[e].apply(this,arguments))}}function u(e,o,t){return l(e)||c.apply(this,arguments)}function a(e,t,r){var i,l=this,c="loglevel";function a(){var e;if(typeof window!==o&&c){try{e=window.localStorage[c]}catch(e){}if(typeof e===o)try{var t=window.document.cookie,n=t.indexOf(encodeURIComponent(c)+"=");-1!==n&&(e=/^([^;]+)/.exec(t.slice(n))[1])}catch(e){}return void 0===l.levels[e]&&(e=void 0),e}}"string"==typeof e?c+=":"+e:"symbol"==typeof e&&(c=void 0),l.name=e,l.levels={TRACE:0,DEBUG:1,INFO:2,WARN:3,ERROR:4,SILENT:5},l.methodFactory=r||u,l.getLevel=function(){return i},l.setLevel=function(t,r){if("string"==typeof t&&void 0!==l.levels[t.toUpperCase()]&&(t=l.levels[t.toUpperCase()]),!("number"==typeof t&&t>=0&&t<=l.levels.SILENT))throw"log.setLevel() called with invalid level: "+t;if(i=t,!1!==r&&function(e){var t=(n[e]||"silent").toUpperCase();if(typeof window!==o&&c){try{return void(window.localStorage[c]=t)}catch(e){}try{window.document.cookie=encodeURIComponent(c)+"="+t+";"}catch(e){}}}(t),s.call(l,t,e),typeof console===o&&t<l.levels.SILENT)return"No console available for logging"},l.setDefaultLevel=function(e){a()||l.setLevel(e,!1)},l.enableAll=function(e){l.setLevel(l.levels.TRACE,e)},l.disableAll=function(e){l.setLevel(l.levels.SILENT,e)};var f=a();null==f&&(f=null==t?"WARN":t),l.setLevel(f,!1)}var f=new a,d={};f.getLogger=function(e){if("symbol"!=typeof e&&"string"!=typeof e||""===e)throw new TypeError("You must supply a name when creating a logger.");var o=d[e];return o||(o=d[e]=new a(e,f.getLevel(),f.methodFactory)),o};var p=typeof window!==o?window.log:void 0;return f.noConflict=function(){return typeof window!==o&&window.log===f&&(window.log=p),f},f.getLoggers=function(){return d},f.default=f,f},o.exports?o.exports=n():t.log=n()}(t={exports:{}},t.exports),t.exports);const{debug:i}=r.getLogger("grpc-transport");var l;!function(e){e[e.FINISH_SEND=1]="FINISH_SEND"}(l||(l={}));const s=new Uint8Array([1]);function c(e){let o="";return e.forEach(((e,t)=>{o+=`${e}: ${t.join(", ")}\r\n`})),function(e){const o=new Uint8Array(e.length);for(let r=0;r!==e.length;++r){const i=e.charCodeAt(r);if(n=void 0,!(9===(n=t=i)||10===n||13===n||t>=32&&t<=126))throw new Error("Metadata contains invalid ASCII");o[r]=i}var t,n;return o}(o)}function u(e){e.debug&&i("websocketRequest",e);const o=function(e){if("https://"===e.substr(0,8))return`wss://${e.substr(8)}`;if(e.startsWith("wss://"))return e;if("http://"===e.substr(0,7))return`ws://${e.substr(7)}`;if(e.startsWith("ws://"))return e;throw new Error("Websocket transport constructed with non-{http,ws}[s]:// host.")}(e.url),t=[];let r;function u(e){if(e===l.FINISH_SEND)r.send(s);else{const o=e,t=new Int8Array(o.byteLength+1);t.set(new Uint8Array([0])),t.set(o,1),r.send(t)}}return{sendMessage:e=>{r&&r.readyState!==r.CONNECTING?u(e):t.push(e)},finishSend:()=>{r&&r.readyState!==r.CONNECTING?u(l.FINISH_SEND):t.push(l.FINISH_SEND)},start:l=>{r=new n(o,["grpc-websockets"]),r.binaryType="arraybuffer",r.onopen=function(){e.debug&&i("websocketRequest.onopen"),r.send(c(l)),t.forEach((e=>{u(e)}))},r.onclose=function(o){e.debug&&i("websocketRequest.onclose",o),e.onEnd()},r.onerror=function(o){e.debug&&i("websocketRequest.onerror",o)},r.onmessage=function(o){e.onChunk(new Uint8Array(o.data))}},cancel:()=>{e.debug&&i("websocket.abort"),r.close()}}}function a(){return e=>u(e)}export{a as WebsocketTransport};
{
"name": "@textile/grpc-transport",
"version": "0.5.1",
"version": "0.5.2",
"main": "dist/cjs/index.js",

@@ -28,3 +28,3 @@ "types": "dist/cjs/index.d.ts",

},
"gitHead": "da454b46dc6baa0ad701ce21a3fab86d82680b50"
"gitHead": "649303c63430721d8a8e42c02620353c484e90bc"
}

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