Socket
Book a DemoInstallSign in
Socket

@babel/plugin-transform-property-mutators

Package Overview
Dependencies
Maintainers
4
Versions
87
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@babel/plugin-transform-property-mutators

Compile ES5 property mutator shorthand syntax to Object.defineProperty

Source
npmnpm
Version
7.0.0-beta.34
Version published
Weekly downloads
21K
-29.88%
Maintainers
4
Weekly downloads
 
Created
Source

@babel/plugin-transform-property-mutators

This plugin allows Babel to transform object initializer mutators into Object.defineProperties.

Example

In

var foo = {
  get bar() {
    return "bar";
  }
};

Out

var foo = Object.defineProperties({}, {
  bar: {
    get: function () {
      return "bar";
    },
    enumerable: true,
    configurable: true
  }
});

Installation

npm install --save-dev @babel/plugin-transform-property-mutators

Usage

.babelrc

{
  "plugins": ["@babel/plugin-transform-property-mutators"]
}

Via CLI

babel --plugins @babel/plugin-transform-property-mutators script.js

Via Node API

require("@babel/core").transform("code", {
  plugins: ["@babel/plugin-transform-property-mutators"]
});

Keywords

babel-plugin

FAQs

Package last updated on 02 Dec 2017

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts