Closed merisbahti closed 3 years ago
Looks like a downlevelIteration
issue. This transpilation isn't "wrong" per se, it's spec vs. non-spec; the respective Babel/TS transforms are actually intentionally written so.
Can see https://github.com/formium/tsdx/issues/760#issuecomment-659453014 and https://github.com/formium/tsdx/issues/659#issuecomment-608519036 that this seems to duplicate.
To summarize, if you're creating a Node lib, you can use --target node
or specify that in browserslistrc
. If you're writing a browser lib, you can set preset-env
to loose: false
.
Per https://github.com/formium/tsdx/issues/760#issuecomment-692979270, I'm looking to add warnings to usage of tsconfig.json
's downlevelIteration
feature and perhaps looking to change preset-env
in TSDX to not set loose
by default, but it's unclear if the latter is breaking as it is for another plugin mentioned there.
Current Behavior
is transpiled to:
Expected behavior
I don't know, it's just that I think that we need to transpile it so that it evaluates to
[undefined, undefined]
Suggested solution(s)
No suggestions, since I don't know how to fix this. Maybe check what settings we have for babel?
Additional context
None.
Your environment