@colyseus/schema
Advanced tools
Comparing version 3.0.0-alpha.4 to 3.0.0-alpha.5
@@ -21,4 +21,4 @@ /// <reference types="node" /> | ||
types: ArraySchema<ReflectionType>; | ||
static encode(instance: Schema, context?: TypeContext): Buffer; | ||
static encode(instance: Schema, context?: TypeContext, it?: Iterator): Buffer; | ||
static decode<T extends Schema = Schema>(bytes: Buffer, it?: Iterator): T; | ||
} |
@@ -52,3 +52,3 @@ "use strict"; | ||
} | ||
static encode(instance, context) { | ||
static encode(instance, context, it = { offset: 0 }) { | ||
if (!context) { | ||
@@ -110,3 +110,2 @@ context = new annotations_1.TypeContext(instance.constructor); | ||
} | ||
const it = { offset: 0 }; | ||
const buf = encoder.encodeAll(it); | ||
@@ -113,0 +112,0 @@ return Buffer.from(buf, 0, it.offset); |
{ | ||
"name": "@colyseus/schema", | ||
"version": "3.0.0-alpha.4", | ||
"version": "3.0.0-alpha.5", | ||
"description": "Binary state serializer with delta encoding for games", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -27,3 +27,3 @@ import { type, PrimitiveType, DefinitionType, TypeContext } from "./annotations"; | ||
static encode (instance: Schema, context?: TypeContext) { | ||
static encode(instance: Schema, context?: TypeContext, it: Iterator = { offset: 0 }) { | ||
if (!context) { | ||
@@ -100,3 +100,2 @@ context = new TypeContext(instance.constructor as typeof Schema); | ||
const it = { offset: 0 }; | ||
const buf = encoder.encodeAll(it); | ||
@@ -103,0 +102,0 @@ return Buffer.from(buf, 0, it.offset); |
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
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
2463289
29976