- Notifications
You must be signed in to change notification settings - Fork3
A Babel plugin for renaming JavaScript properties
License
NotificationsYou must be signed in to change notification settings
preactjs/babel-plugin-transform-rename-properties
Folders and files
| Name | Name | Last commit message | Last commit date | |
|---|---|---|---|---|
Repository files navigation
Rename JavaScript properties.
$ yarn add --dev babel-plugin-transform-rename-propertiesInput 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"]();}
This plugin is licensed under the MIT license. SeeLICENSE.
About
A Babel plugin for renaming JavaScript properties
Topics
Resources
License
Code of conduct
Uh oh!
There was an error while loading.Please reload this page.
Stars
Watchers
Forks
Uh oh!
There was an error while loading.Please reload this page.
Contributors2
Uh oh!
There was an error while loading.Please reload this page.