function assert ( someVariable , msg ? ) { if ( ! someVariable ) { throw new Error ( msg ) ; } } function multiplyA ( x , y ) { assert ( typeof x === "number" ) ; assert ( typeof y === "number" ) ; return x * y ; } function multiplyB ( x , y ) { if ( typeof x !== "number" ) { throw new Error ( ) ; } if ( typeof y !== "number" ) { throw new Error ( ) ; } return x * y ; } function isString ( val ) { return typeof val === "string" ; } function assertIsString ( val ) { if ( typeof val !== "string" ) { throw new Error ( "Not a string!" ) ; } } function usageC ( str ) { assertIsString ( str ) ; str . toUpperCase ( ) ; } function assertIsDefined < T > ( val ) { if ( val === undefined || val === null ) { throw new Error ( `Expected 'val' to be defined, but received ${ val }` ) ; } } function usageD ( str ) { assertIsDefined ( str ) ; str . toUpperCase ( ) ; } export { } ;