tsx
tsx copied to clipboard
Using `typeof` in REPL results in `undefined` output
Problem
I noticed that when using the REPL (yarn tsx), most expressions with typeof result in the output line being undefined. If it's in a ternary it seems to be okay, though.
Expected behavior
I expected this to match the behavior of the Node REPL, outputting the resultant value of the expression.
Minimal reproduction URL
https://github.com/esbuild-kit/tsx/assets/81224/eacf8fc5-8b7b-4085-b2b9-79a3b6c02d23
Version
v3.13.0
Node.js version
v18.16.1
Package manager
yarn
Operating system
macOS
Contributions
- [ ] I plan to open a pull request for this issue
- [ ] I plan to make a financial contribution to this project
This is blocked by https://github.com/evanw/esbuild/issues/3502, but we may be able to hack around this by wrapping it in a IIFE: https://esbuild.github.io/try/#dAAwLjE5LjcAACgoKSA9PiB0eXBlb2YgMSkoKQ