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

@geckos.io/common

Package Overview
Dependencies
Maintainers
1
Versions
52
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@geckos.io/common - npm Package Compare versions

Comparing version 1.6.1 to 1.7.0

8

lib/sendMessage.js
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
var helpers_1 = require("./helpers");
var constants_1 = require("./constants");
var object_sizeof_1 = __importDefault(require("object-sizeof"));
var SendMessage = function (dataChannel, maxMessageSize, eventName, data) {

@@ -13,3 +9,5 @@ var _a;

var send = function (data) {
if (typeof maxMessageSize === 'number' && object_sizeof_1.default(data) > maxMessageSize)
var _a;
var bytes = (_a = data.byteLength) !== null && _a !== void 0 ? _a : data.length * 2; // (times 2 for characters that uses 2 bytes per char)
if (typeof maxMessageSize === 'number' && bytes > maxMessageSize)
throw new Error("maxMessageSize of " + maxMessageSize + " exceeded");

@@ -16,0 +14,0 @@ else

/// <reference types="node" />
import http from 'http';
import { IncomingMessage } from 'http';
declare const ArrayBufferView: any;

@@ -23,3 +23,15 @@ export { ArrayBufferView };

autoManageBuffering?: boolean;
authorization?: (header: string | undefined) => Promise<boolean | any>;
/** Set a custom port range for the WebRTC connection. */
portRange?: {
/** Minimum port range (defaults to 0) */
min: number;
/** Minimum port range (defaults to 65535) */
max: number;
};
/**
* A async function to authenticate and authorize a user.
* @param auth The authentication token
* @param request The incoming http request
*/
authorization?: (auth: string | undefined, request: IncomingMessage) => Promise<boolean | any>;
}

@@ -39,3 +51,3 @@ export interface ClientOptions {

}
declare type CorsOptionsOriginFunction = (req: http.IncomingMessage) => string;
declare type CorsOptionsOriginFunction = (req: IncomingMessage) => string;
export interface CorsOptions {

@@ -57,5 +69,2 @@ origin: string | CorsOptionsOriginFunction;

}
export interface ConnectionEventCallbackServer {
(channel: any): void;
}
export interface DisconnectEventCallbackServer {

@@ -62,0 +71,0 @@ (connectionState: 'disconnected' | 'failed' | 'closed'): void;

{
"name": "@geckos.io/common",
"version": "1.6.1",
"version": "1.7.0",
"description": "The common module for @geckos.io/server and @geckos.io/client.",

@@ -28,4 +28,3 @@ "main": "lib",

"dependencies": {
"eventemitter3": "^4.0.0",
"object-sizeof": "^1.6.0"
"eventemitter3": "^4.0.4"
},

@@ -32,0 +31,0 @@ "funding": {

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

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