What is @babel/plugin-transform-typeof-symbol?
The @babel/plugin-transform-typeof-symbol package is a plugin for Babel, a JavaScript compiler, that ensures the behavior of the 'typeof' operator is spec-compliant when used with symbols. In environments that do not fully support symbols, this plugin transforms 'typeof' checks to a method that can correctly identify 'symbol' types.
Transform typeof checks for symbols
This code represents the transformation that the plugin applies to 'typeof' checks. It defines a function that can correctly identify symbols, even in environments that do not natively support the 'symbol' type.
var _typeof = function(obj) { return obj && typeof Symbol !== 'undefined' && obj.constructor === Symbol ? 'symbol' : typeof obj; };