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

@colyseus/schema

Package Overview
Dependencies
Maintainers
1
Versions
313
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.3.8 to 0.3.9

29

lib/annotations.js

@@ -149,4 +149,3 @@ "use strict";

var newIndex = decode.number(bytes, it);
// index change check
var indexChangedFrom = void 0;
var indexChangedFrom = void 0; // index change check
if (decode.indexChangeCheck(bytes, it)) {

@@ -157,5 +156,5 @@ decode.uint8(bytes, it);

}
var isNew = (!hasIndexChange && !value[newIndex]) || (hasIndexChange && indexChangedFrom === undefined);
if (type_1.prototype instanceof Schema) {
var item = void 0;
var isNew = (hasIndexChange && indexChangedFrom === undefined && newIndex !== undefined);
if (isNew) {

@@ -167,3 +166,3 @@ item = new type_1();

}
else if (newIndex !== undefined) {
else {
item = valueRef_1[newIndex];

@@ -182,7 +181,3 @@ }

}
item.$parent = this_1;
item.decode(bytes, it);
if (isNew && valueRef_1.onAdd) {
valueRef_1.onAdd(item, newIndex);
}
value[newIndex] = item;

@@ -193,2 +188,8 @@ }

}
if (isNew && valueRef_1.onAdd) {
valueRef_1.onAdd(value[newIndex], newIndex);
}
else if (valueRef_1.onChange) {
valueRef_1.onChange(value[newIndex], newIndex);
}
change.push(value[newIndex]);

@@ -258,9 +259,9 @@ }

value[newKey] = item;
if (isNew && valueRef.onAdd) {
valueRef.onAdd(item, newKey);
}
else if (valueRef.onChange) {
valueRef.onChange(item, newKey);
}
}
if (isNew && valueRef.onAdd) {
valueRef.onAdd(item, newKey);
}
else if (valueRef.onChange) {
valueRef.onChange(item, newKey);
}
}

@@ -267,0 +268,0 @@ }

@@ -36,2 +36,3 @@ "use strict";

arr.onRemove = _this.onRemove;
arr.onChange = _this.onChange;
return arr;

@@ -38,0 +39,0 @@ }

@@ -21,2 +21,3 @@ "use strict";

map.onRemove = _this.onRemove;
map.onChange = _this.onChange;
return map;

@@ -23,0 +24,0 @@ }

{
"name": "@colyseus/schema",
"version": "0.3.8",
"version": "0.3.9",
"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