Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

A Babel plugin for renaming JavaScript properties

License

NotificationsYou must be signed in to change notification settings

preactjs/babel-plugin-transform-rename-properties

Repository files navigation

Rename JavaScript properties.

Installation

$ yarn add --dev babel-plugin-transform-rename-properties

Example

Input file:

constobj={foo:{bar:1},quux(){return2;}};const{ foo}=obj;functionquux(obj){returnobj.foo.bar+obj.quux();}

.babelrc:

{"plugins": [    ["babel-plugin-transform-rename-properties",      {"rename": {"foo":"__FOO__","quux":"I HAVE SPACES"        }      }    ]  ]}

Output:

constobj={__FOO__:{bar:1},"I HAVE SPACES"(){return2;}};const{__FOO__:foo}=obj;functionquux(obj){returnobj.__FOO__.bar+obj["I HAVE SPACES"]();}

License

This plugin is licensed under the MIT license. SeeLICENSE.

About

A Babel plugin for renaming JavaScript properties

Topics

Resources

License

Code of conduct

Stars

Watchers

Forks

Contributors2

  •  
  •  

[8]ページ先頭

©2009-2025 Movatter.jp