11import { TypeSystem } from '../../../system' ;
2- import { Type } from '../../../type' ;
2+ import type { Type } from '../../../type' ;
33
44export const testBinaryCodegen = ( transcode : ( system : TypeSystem , type : Type , value : unknown ) => void ) => {
55 describe ( '"any" type' , ( ) => {
@@ -195,25 +195,25 @@ export const testBinaryCodegen = (transcode: (system: TypeSystem, type: Type, va
195195 const system = new TypeSystem ( ) ;
196196 const t = system . t ;
197197 const type = t . obj ;
198- const value : { } = { } ;
198+ const value : any = { } ;
199199 expect ( transcode ( system , type , value ) ) . toStrictEqual ( value ) ;
200200 } ) ;
201201
202202 test ( 'can encode empty object, which has optional fields' , ( ) => {
203203 const system = new TypeSystem ( ) ;
204204 const t = system . t ;
205205 const type = t . Object ( t . propOpt ( 'field1' , t . str ) ) ;
206- const value1 : { } = { } ;
206+ const value1 : any = { } ;
207207 expect ( transcode ( system , type , value1 ) ) . toStrictEqual ( value1 ) ;
208- const value2 : { } = { field1 : 'abc' } ;
208+ const value2 : any = { field1 : 'abc' } ;
209209 expect ( transcode ( system , type , value2 ) ) . toStrictEqual ( value2 ) ;
210210 } ) ;
211211
212212 test ( 'can encode fixed size object' , ( ) => {
213213 const system = new TypeSystem ( ) ;
214214 const t = system . t ;
215215 const type = t . Object ( t . prop ( 'field1' , t . str ) , t . prop ( 'field2' , t . num ) , t . prop ( 'bool' , t . bool ) ) ;
216- const value : { } = {
216+ const value : any = {
217217 field1 : 'abc' ,
218218 field2 : 123 ,
219219 bool : true ,
@@ -225,7 +225,7 @@ export const testBinaryCodegen = (transcode: (system: TypeSystem, type: Type, va
225225 const system = new TypeSystem ( ) ;
226226 const t = system . t ;
227227 const type = t . Object ( t . prop ( 'id' , t . str ) , t . propOpt ( 'name' , t . str ) ) ;
228- const value : { } = {
228+ const value : any = {
229229 id : 'xxxxx' ,
230230 name : 'Go Lang' ,
231231 } ;
@@ -241,7 +241,7 @@ export const testBinaryCodegen = (transcode: (system: TypeSystem, type: Type, va
241241 t . prop ( 'age' , t . num ) ,
242242 t . propOpt ( 'address' , t . str ) ,
243243 ) ;
244- const value : { } = {
244+ const value : any = {
245245 id : 'xxxxx' ,
246246 name : 'Go Lang' ,
247247 age : 30 ,
@@ -256,7 +256,7 @@ export const testBinaryCodegen = (transcode: (system: TypeSystem, type: Type, va
256256 const type = t
257257 . Object ( t . prop ( 'id' , t . str ) , t . propOpt ( 'name' , t . str ) , t . prop ( 'age' , t . num ) , t . propOpt ( 'address' , t . str ) )
258258 . options ( { encodeUnknownFields : true } ) ;
259- const value : { } = {
259+ const value : any = {
260260 id : 'xxxxx' ,
261261 name : 'Go Lang' ,
262262 ____unknownField : 123 ,
@@ -320,7 +320,7 @@ export const testBinaryCodegen = (transcode: (system: TypeSystem, type: Type, va
320320 const type = t
321321 . Object ( t . propOpt ( 'id' , t . str ) , t . propOpt ( 'name' , t . str ) , t . propOpt ( 'address' , t . str ) )
322322 . options ( { encodeUnknownFields : true } ) ;
323- let value : { } = {
323+ let value : any = {
324324 id : 'xxxxx' ,
325325 name : 'Go Lang' ,
326326 ____unknownField : 123 ,
@@ -347,7 +347,7 @@ export const testBinaryCodegen = (transcode: (system: TypeSystem, type: Type, va
347347 const type = t
348348 . Object ( t . propOpt ( 'id' , t . str ) , t . propOpt ( 'name' , t . str ) , t . propOpt ( 'address' , t . str ) )
349349 . options ( { encodeUnknownFields : false } ) ;
350- let value : { } = {
350+ let value : any = {
351351 id : 'xxxxx' ,
352352 name : 'Go Lang' ,
353353 address : '123 Main St' ,
@@ -374,31 +374,31 @@ export const testBinaryCodegen = (transcode: (system: TypeSystem, type: Type, va
374374 const system = new TypeSystem ( ) ;
375375 const t = system . t ;
376376 const type = t . map ;
377- const value : { } = { } ;
377+ const value : any = { } ;
378378 expect ( transcode ( system , type , value ) ) . toStrictEqual ( value ) ;
379379 } ) ;
380380
381381 test ( 'can encode empty map with one key' , ( ) => {
382382 const system = new TypeSystem ( ) ;
383383 const t = system . t ;
384384 const type = t . map ;
385- const value : { } = { a : 'asdf' } ;
385+ const value : any = { a : 'asdf' } ;
386386 expect ( transcode ( system , type , value ) ) . toStrictEqual ( value ) ;
387387 } ) ;
388388
389389 test ( 'can encode typed map with two keys' , ( ) => {
390390 const system = new TypeSystem ( ) ;
391391 const t = system . t ;
392392 const type = t . Map ( t . bool ) ;
393- const value : { } = { x : true , y : false } ;
393+ const value : any = { x : true , y : false } ;
394394 expect ( transcode ( system , type , value ) ) . toStrictEqual ( value ) ;
395395 } ) ;
396396
397397 test ( 'can encode nested maps' , ( ) => {
398398 const system = new TypeSystem ( ) ;
399399 const t = system . t ;
400400 const type = t . Map ( t . Map ( t . bool ) ) ;
401- const value : { } = { a : { x : true , y : false } } ;
401+ const value : any = { a : { x : true , y : false } } ;
402402 expect ( transcode ( system , type , value ) ) . toStrictEqual ( value ) ;
403403 } ) ;
404404 } ) ;
0 commit comments