| 
				
					 | 
			2 年之前 | |
|---|---|---|
| .. | ||
| lib | 2 年之前 | |
| .npmignore | 2 年之前 | |
| README.md | 2 年之前 | |
| package.json | 2 年之前 | |
ES6 introduces a new native type called symbols. This transformer wraps all
typeofexpressions with a method that replicates native behaviour. (ie. returning "symbol" for symbols)
In
typeof Symbol() === "symbol";
Out
var _typeof = function (obj) {
  return obj && obj.constructor === Symbol ? "symbol" : typeof obj;
};
_typeof(Symbol()) === "symbol";
npm install --save-dev babel-plugin-transform-es2015-typeof-symbol
.babelrc (Recommended).babelrc
{
  "plugins": ["transform-es2015-typeof-symbol"]
}
babel --plugins transform-es2015-typeof-symbol script.js
require("babel-core").transform("code", {
  plugins: ["transform-es2015-typeof-symbol"]
});