Socket
Socket
Sign inDemoInstall

@babel/plugin-transform-typeof-symbol

Package Overview
Dependencies
81
Maintainers
5
Versions
74
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 7.0.0-beta.49 to 7.0.0-beta.50

8

package.json
{
"name": "@babel/plugin-transform-typeof-symbol",
"version": "7.0.0-beta.49",
"version": "7.0.0-beta.50",
"description": "This transformer wraps all typeof expressions with a method that replicates native behaviour. (ie. returning “symbol” for symbols)",

@@ -12,3 +12,3 @@ "repository": "https://github.com/babel/babel/tree/master/packages/babel-plugin-transform-typeof-symbol",

"dependencies": {
"@babel/helper-plugin-utils": "7.0.0-beta.49"
"@babel/helper-plugin-utils": "7.0.0-beta.50"
},

@@ -19,5 +19,5 @@ "peerDependencies": {

"devDependencies": {
"@babel/core": "7.0.0-beta.49",
"@babel/helper-plugin-test-runner": "7.0.0-beta.49"
"@babel/core": "7.0.0-beta.50",
"@babel/helper-plugin-test-runner": "7.0.0-beta.50"
}
}
# @babel/plugin-transform-typeof-symbol
> ES6 introduces a new native type called [symbols](https://babeljs.io/learn-es2015/#ecmascript-2015-features-symbols). This transformer wraps all `typeof` expressions with a method that replicates native behaviour. (ie. returning "symbol" for symbols)
> This transformer wraps all typeof expressions with a method that replicates native behaviour. (ie. returning “symbol” for symbols)
## Example
See our website [@babel/plugin-transform-typeof-symbol](https://new.babeljs.io/docs/en/next/babel-plugin-transform-typeof-symbol.html) for more information.
**In**
## Install
```javascript
typeof Symbol() === "symbol";
```
Using npm:
**Out**
```javascript
var _typeof = function (obj) {
return obj && obj.constructor === Symbol ? "symbol" : typeof obj;
};
_typeof(Symbol()) === "symbol";
```
## Installation
```sh
npm install --save-dev @babel/plugin-transform-typeof-symbol
npm install --save @babel/plugin-transform-typeof-symbol
```
## Usage
or using yarn:
### Via `.babelrc` (Recommended)
**.babelrc**
```json
{
"plugins": ["@babel/plugin-transform-typeof-symbol"]
}
```
### Via CLI
```sh
babel --plugins @babel/plugin-transform-typeof-symbol script.js
yarn add --save @babel/plugin-transform-typeof-symbol
```
### Via Node API
```javascript
require("@babel/core").transform("code", {
plugins: ["@babel/plugin-transform-typeof-symbol"]
});
```
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc