File tree Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Expand file tree Collapse file tree 3 files changed +6
-6
lines changed Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " @colyseus/schema" ,
3
- "version" : " 2.0.16 " ,
3
+ "version" : " 2.0.17 " ,
4
4
"description" : " Binary state serializer with delta encoding for games" ,
5
5
"bin" : {
6
6
"schema-codegen" : " ./bin/schema-codegen"
78
78
"source-map-support" : " ^0.5.13" ,
79
79
"ts-node" : " ^7.0.1" ,
80
80
"tslib" : " ^2.1.0" ,
81
- "tsx" : " ^3.12.7 " ,
81
+ "tsx" : " ^3.13.0 " ,
82
82
"typescript" : " ^5.0.4"
83
83
},
84
84
"nyc" : {
Original file line number Diff line number Diff line change @@ -898,15 +898,15 @@ export abstract class Schema {
898
898
const schema = this . _definition . schema ;
899
899
const deprecated = this . _definition . deprecated ;
900
900
901
- const obj : ToJSON < typeof this > = { } ;
901
+ const obj : unknown = { } ;
902
902
for ( let field in schema ) {
903
903
if ( ! deprecated [ field ] && this [ field ] !== null && typeof ( this [ field ] ) !== "undefined" ) {
904
904
obj [ field ] = ( typeof ( this [ field ] [ 'toJSON' ] ) === "function" )
905
905
? this [ field ] [ 'toJSON' ] ( )
906
906
: this [ `_${ field } ` ] ;
907
907
}
908
908
}
909
- return obj ;
909
+ return obj as ToJSON < typeof this > ;
910
910
}
911
911
912
912
discardAllChanges ( ) {
Original file line number Diff line number Diff line change @@ -9,10 +9,10 @@ export type NonFunctionPropNames<T> = {
9
9
[ K in keyof T ] : T [ K ] extends Function ? never : K
10
10
} [ keyof T ] ;
11
11
12
- export type ToJSON < T > = Partial < NonFunctionProps < {
12
+ export type ToJSON < T > = NonFunctionProps < {
13
13
[ K in keyof T ] : T [ K ] extends MapSchema < infer U >
14
14
? Record < string , U >
15
15
: T [ K ] extends ArraySchema < infer U >
16
16
? U [ ]
17
17
: T [ K ]
18
- } > > ;
18
+ } > ;
You can’t perform that action at this time.
0 commit comments