namespace DeserializingAny { class User { name : string ; constructor ( name ) { this . name = name ; } } function deserialize ( input ) { return JSON . parse ( input ) ; } function greet ( user ) { console . log ( `Hi ${ user . name }!` ) ; } greet ( deserialize ( '{ "name": "Alice" }' ) ) ; greet ( deserialize ( '{}' ) ) ; }