@babel/plugin-transform-typeof-symbol
Example
In
typeof Symbol() === "symbol";
Out
var _typeof = function (obj) {
return obj && obj.constructor === Symbol ? "symbol" : typeof obj;
};
_typeof(Symbol()) === "symbol";
Installation
npm install --save-dev @babel/plugin-transform-typeof-symbol
Usage
Via .babelrc (Recommended)
.babelrc
{
"plugins": ["@babel/plugin-transform-typeof-symbol"]
}
Via CLI
babel --plugins @babel/plugin-transform-typeof-symbol script.js
Via Node API
require("@babel/core").transform("code", {
plugins: ["@babel/plugin-transform-typeof-symbol"]
});