_interopRequireWildcard breaks on nodejs cases #10577
Labels
i: bug
i: duplicate
outdated
A closed issue/PR that is archived due to age. Recommended to make a new issue
Bug Report
Current Behavior
import * as isNode from 'detect-node';
(TypeScript syntax)const isNode = require('detect-node')
(again TypeScript)The result would be correct, however, internally it uses
WeakMap
based cache, and by some reason, expects any module to be resolved to an object.https://github.com/babel/babel/blob/master/packages/babel-helpers/src/helpers.js#L623-L626
require('detect-node')
resolves totrue
orfalse
A clear and concise description of the behavior.
Input Code
Expected behavior/code
Possible Solution
Many "object like" structures are not "WeakMapable", however -
typeof value === 'object'
would be more than enought.The text was updated successfully, but these errors were encountered: