@colyseus/schema
Advanced tools
Comparing version 2.0.27 to 2.0.28
@@ -20,5 +20,7 @@ "use strict"; | ||
(0, typeRegistry_1.registerType)("collection", { constructor: CollectionSchema_1.CollectionSchema, }); | ||
const utils_1 = require("./utils"); | ||
(0, utils_1.checkTypeScriptConfig)(); | ||
// Utils | ||
var utils_1 = require("./utils"); | ||
Object.defineProperty(exports, "dumpChanges", { enumerable: true, get: function () { return utils_1.dumpChanges; } }); | ||
var utils_2 = require("./utils"); | ||
Object.defineProperty(exports, "dumpChanges", { enumerable: true, get: function () { return utils_2.dumpChanges; } }); | ||
const encode = require("./encoding/encode"); | ||
@@ -25,0 +27,0 @@ exports.encode = encode; |
@@ -10,5 +10,5 @@ export declare const SWITCH_TO_STRUCTURE = 255; | ||
DELETE = 64, | ||
DELETE_AND_ADD = 192, | ||
TOUCH = 1, | ||
DELETE_AND_ADD = 192,// 11100000 | ||
TOUCH = 1,// 00000000 | ||
CLEAR = 10 | ||
} |
@@ -1,2 +0,3 @@ | ||
import { Schema } from "./"; | ||
import { Schema } from "./Schema"; | ||
export declare function dumpChanges(schema: Schema): {}; | ||
export declare function checkTypeScriptConfig(): void; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.dumpChanges = void 0; | ||
exports.checkTypeScriptConfig = exports.dumpChanges = void 0; | ||
const Reflection_1 = require("./Reflection"); | ||
function dumpChanges(schema) { | ||
@@ -23,2 +24,26 @@ const changeTrees = [schema['$changes']]; | ||
exports.dumpChanges = dumpChanges; | ||
function checkTypeScriptConfig() { | ||
const r = new Reflection_1.ReflectionField(); | ||
const descriptor = Object.getOwnPropertyDescriptor(r, "name"); | ||
if (descriptor.get === undefined || descriptor.set === undefined) { | ||
console.error(` | ||
‼️ Please check your tsconfig.json ‼️ | ||
@colyseus/schema requires the following settings: | ||
------------------------------------------------- | ||
"compilerOptions": { | ||
// ... | ||
"useDefineForClassFields": false, | ||
"experimentalDecorators": true, | ||
// ... | ||
} | ||
------------------------------------------------- | ||
More info → https://github.com/colyseus/colyseus/issues/510#issuecomment-1507828422 | ||
`); | ||
process.exit(1); | ||
} | ||
} | ||
exports.checkTypeScriptConfig = checkTypeScriptConfig; | ||
//# sourceMappingURL=utils.js.map |
{ | ||
"name": "@colyseus/schema", | ||
"version": "2.0.27", | ||
"version": "2.0.28", | ||
"description": "Binary state serializer with delta encoding for games", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -24,2 +24,5 @@ export { Schema } from "./Schema"; | ||
import { checkTypeScriptConfig } from "./utils"; | ||
checkTypeScriptConfig(); | ||
// Utils | ||
@@ -63,2 +66,2 @@ export { dumpChanges } from "./utils"; | ||
export { OPERATION } from "./spec"; | ||
export { OPERATION } from "./spec"; |
@@ -159,2 +159,2 @@ import { type, PrimitiveType, Context, DefinitionType } from "./annotations"; | ||
} | ||
} | ||
} |
@@ -1,2 +0,3 @@ | ||
import { Schema } from "./"; | ||
import { Schema } from "./Schema"; | ||
import { ReflectionField } from "./Reflection"; | ||
import { ChangeTree } from "./changes/ChangeTree"; | ||
@@ -28,2 +29,26 @@ | ||
return dump; | ||
} | ||
} | ||
export function checkTypeScriptConfig() { | ||
const r = new ReflectionField(); | ||
const descriptor = Object.getOwnPropertyDescriptor(r, "name"); | ||
if (descriptor.get === undefined || descriptor.set === undefined) { | ||
console.error(` | ||
‼️ Please check your tsconfig.json ‼️ | ||
@colyseus/schema requires the following settings: | ||
------------------------------------------------- | ||
"compilerOptions": { | ||
// ... | ||
"useDefineForClassFields": false, | ||
"experimentalDecorators": true, | ||
// ... | ||
} | ||
------------------------------------------------- | ||
More info → https://github.com/colyseus/colyseus/issues/510#issuecomment-1507828422 | ||
`); | ||
process.exit(1); | ||
} | ||
} |
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
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 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 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 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 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 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 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 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 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
1804265
168
22096