The CJS build of TS-Pattern generates es5 javascript code, and turns the generator syntax into regeneratorRuntime calls, a function that's part of Babel's standard library:
The issue is that there is no guarantee that this function is in scope where TS-Pattern's CJS build is executed. This is a microbundle bug that has a closed issue here: https://github.com/developit/microbundle/issues/708 it's supposedly fixed, but I still see this behavior with the latest version of micro bundle, so this PR just turns the only generator of TS-Pattern into an iterator object.
The CJS build of TS-Pattern generates es5 javascript code, and turns the generator syntax into
regeneratorRuntime
calls, a function that's part of Babel's standard library:The issue is that there is no guarantee that this function is in scope where TS-Pattern's CJS build is executed. This is a microbundle bug that has a closed issue here: https://github.com/developit/microbundle/issues/708 it's supposedly fixed, but I still see this behavior with the latest version of micro bundle, so this PR just turns the only generator of TS-Pattern into an iterator object.