babel-plugin-unsafe-optimizations-duplicated-strings

1.1.0 • Public • Published

babel-plugin-unsafe-optimizations-duplicated-strings

This plugin creates local variables to store repeated strings.

For example:

const data = {
  prop1: 'default',
  prop2: 'default',
  prop3: 'default',
  prop4: 'default',
  prop5: 'default',
};

will be transformed to:

const s = 'default';
const data = {
  prop1: s,
  prop2: s,
  prop3: s,
  prop4: s,
  prop5: s,
};

Why is it unsafe?

This one actually looks safe.

Configuration

target

Selects JavaScript syntax version for the output code. Supported values are: "es5", "es6".

Readme

Keywords

Package Sidebar

Install

npm i babel-plugin-unsafe-optimizations-duplicated-strings

Weekly Downloads

1

Version

1.1.0

License

ISC

Unpacked Size

7.51 kB

Total Files

3

Last publish

Collaborators

  • pseon