@colyseus/schema
Advanced tools
Comparing version 2.0.10 to 2.0.11
@@ -131,2 +131,6 @@ "use strict"; | ||
setAt(index, value) { | ||
if (value === undefined || value === null) { | ||
console.error("ArraySchema items cannot be null nor undefined; Use `deleteAt(index)` instead."); | ||
return; | ||
} | ||
if (value['$changes'] !== undefined) { | ||
@@ -133,0 +137,0 @@ value['$changes'].setParent(this, this.$changes.root, index); |
@@ -75,2 +75,5 @@ "use strict"; | ||
} | ||
// Force "key" as string | ||
// See: https://github.com/colyseus/colyseus/issues/561#issuecomment-1646733468 | ||
key = key.toString(); | ||
// get "index" for this value. | ||
@@ -77,0 +80,0 @@ const hasIndex = typeof (this.$changes.indexes[key]) !== "undefined"; |
{ | ||
"name": "@colyseus/schema", | ||
"version": "2.0.10", | ||
"version": "2.0.11", | ||
"description": "Binary state serializer with delta encoding for games", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -165,2 +165,7 @@ import { ChangeTree } from "../changes/ChangeTree"; | ||
setAt(index: number, value: V) { | ||
if (value === undefined || value === null) { | ||
console.error("ArraySchema items cannot be null nor undefined; Use `deleteAt(index)` instead."); | ||
return; | ||
} | ||
if (value['$changes'] !== undefined) { | ||
@@ -167,0 +172,0 @@ (value['$changes'] as ChangeTree).setParent(this, this.$changes.root, index); |
@@ -104,2 +104,6 @@ import { SchemaDecoderCallbacks } from "../Schema"; | ||
// Force "key" as string | ||
// See: https://github.com/colyseus/colyseus/issues/561#issuecomment-1646733468 | ||
key = key.toString() as K; | ||
// get "index" for this value. | ||
@@ -106,0 +110,0 @@ const hasIndex = typeof(this.$changes.indexes[key]) !== "undefined"; |
Sorry, the diff of this file is too big to display
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
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1621210
20184