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

@colyseus/schema

Package Overview
Dependencies
Maintainers
1
Versions
337
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@colyseus/schema - npm Package Compare versions

Comparing version 0.4.25-alpha.1 to 0.4.25-alpha.2

27

lib/Schema.js

@@ -64,4 +64,10 @@ "use strict";

}
function encodePrimitiveType(type, bytes, value) {
function encodePrimitiveType(type, bytes, value, klass, field) {
var encodeFunc = encode[type];
if (value === undefined) {
bytes.push(spec_1.NIL);
}
else {
assertType(value, type, klass, field);
}
if (encodeFunc) {

@@ -177,2 +183,5 @@ encodeFunc(bytes, value);

if (value.length > newLength_1) {
// decrease removed items from number of changes.
// no need to iterate through them, as they're going to be removed.
numChanges -= value.length - newLength_1;
value.splice(newLength_1).forEach(function (itemRemoved, i) {

@@ -395,2 +404,5 @@ if (itemRemoved.onRemove) {

var item = this["_" + field][index];
if (item === undefined) {
continue;
}
if (client && filter) {

@@ -404,6 +416,2 @@ // skip if not allowed by custom filter

encode.number(bytes, index);
if (item === undefined) {
encode.uint8(bytes, spec_1.NIL);
continue;
}
var indexChange = value.$changes.getIndexChange(item);

@@ -420,4 +428,3 @@ if (indexChange !== undefined) {

encode.number(bytes, index);
assertType(item, type[0], this, field);
if (!encodePrimitiveType(type[0], bytes, item)) {
if (!encodePrimitiveType(type[0], bytes, item, this, field)) {
console.log("cannot encode", schema[field]);

@@ -482,4 +489,3 @@ continue;

else if (item !== undefined) {
assertType(item, type.map, this, field);
encodePrimitiveType(type.map, bytes, item);
encodePrimitiveType(type.map, bytes, item, this, field);
}

@@ -506,4 +512,3 @@ else {

encode.number(bytes, fieldIndex);
assertType(value, type, this, field);
if (!encodePrimitiveType(type, bytes, value)) {
if (!encodePrimitiveType(type, bytes, value, this, field)) {
console.log("cannot encode", schema[field]);

@@ -510,0 +515,0 @@ continue;

{
"name": "@colyseus/schema",
"version": "0.4.25-alpha.1",
"version": "0.4.25-alpha.2",
"description": "Schema-based binary serializer / de-serializer.",

@@ -5,0 +5,0 @@ "main": "lib/index.js",

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