@colyseus/schema
Advanced tools
Comparing version 1.0.43 to 1.0.44
@@ -87,6 +87,7 @@ "use strict"; | ||
var hasExpression = (_c = prop === null || prop === void 0 ? void 0 : prop.expression) === null || _c === void 0 ? void 0 : _c.arguments; | ||
var hasDecorator = ((propDecorator === null || propDecorator === void 0 ? void 0 : propDecorator.length) > 0); | ||
/** | ||
* neither a `@type()` decorator or `type()` call. skip. | ||
*/ | ||
if (!propDecorator && !hasExpression) { | ||
if (!hasDecorator && !hasExpression) { | ||
break; | ||
@@ -208,2 +209,3 @@ } | ||
// TypeScript 4.7 and below | ||
// @ts-ignore | ||
if (node.decorators) { | ||
@@ -213,6 +215,9 @@ return node.decorators; | ||
// TypeScript 4.8 and above | ||
// @ts-ignore | ||
if (ts.canHaveDecorators && ts.canHaveDecorators(node)) { | ||
// @ts-ignore | ||
var decorators = ts.getDecorators(node); | ||
return decorators ? Array.from(decorators) : undefined; | ||
} | ||
// @ts-ignore | ||
return (_a = node.modifiers) === null || _a === void 0 ? void 0 : _a.filter(ts.isDecorator); | ||
@@ -219,0 +224,0 @@ } |
{ | ||
"name": "@colyseus/schema", | ||
"version": "1.0.43", | ||
"version": "1.0.44", | ||
"description": "Binary state serializer with delta encoding for games", | ||
@@ -5,0 +5,0 @@ "bin": { |
@@ -102,2 +102,3 @@ import * as ts from "typescript"; | ||
const hasExpression = prop?.expression?.arguments; | ||
const hasDecorator = (propDecorator?.length > 0); | ||
@@ -107,3 +108,3 @@ /** | ||
*/ | ||
if (!propDecorator && !hasExpression) { | ||
if (!hasDecorator && !hasExpression) { | ||
break; | ||
@@ -264,6 +265,9 @@ } | ||
// TypeScript 4.7 and below | ||
// @ts-ignore | ||
if (node.decorators) { return node.decorators; } | ||
// TypeScript 4.8 and above | ||
// @ts-ignore | ||
if (ts.canHaveDecorators && ts.canHaveDecorators(node)) { | ||
// @ts-ignore | ||
const decorators = ts.getDecorators(node); | ||
@@ -273,3 +277,4 @@ return decorators ? Array.from(decorators) : undefined; | ||
// @ts-ignore | ||
return node.modifiers?.filter(ts.isDecorator); | ||
} |
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
1605336
19993