Closed hayes closed 10 months ago
By default interopDefault
returns a proxified object that allows mixed syntax usage. We might support interopDefault({ default: 'test', x: 123 }, { strict: true })
to always return default
key.
preferNamespace
added as an opt-in (and non behavior changing) feature see https://github.com/unjs/mlly/commit/5d23c98a46fefd6e812fe837cbd849164eec6b50 and https://github.com/unjs/mlly/commit/14eb72d0f571e06dcd127c0d5fec7b4fa49609f9
I hope it can help in your case but if you have some usecases that belive this behavior being default could be beneficial please mention.
Environment
node 18
Reproduction
Describe the bug
I would expect in this case that the original module would be returned rather the just the default export
test
Additional context
Checking if newModule is an object after it is assigned here: https://github.com/unjs/mlly/blob/main/src/cjs.ts#L38C3-L38C3 and returning the sourceModule instead if its not an object or function should work
Logs
No response