1 | # babel-plugin-transform-es3-property-literals
|
2 |
|
3 | > Ensure that reserved words are quoted in object property keys
|
4 |
|
5 | ## Example
|
6 |
|
7 | **In**
|
8 |
|
9 | ```javascript
|
10 | var foo = {
|
11 | catch: function () {}
|
12 | };
|
13 | ```
|
14 |
|
15 | **Out**
|
16 |
|
17 | ```javascript
|
18 | var foo = {
|
19 | "catch": function () {}
|
20 | };
|
21 | ```
|
22 |
|
23 | ## Installation
|
24 |
|
25 | ```sh
|
26 | npm install --save-dev babel-plugin-transform-es3-property-literals
|
27 | ```
|
28 |
|
29 | ## Usage
|
30 |
|
31 | ### Via `.babelrc` (Recommended)
|
32 |
|
33 | **.babelrc**
|
34 |
|
35 | ```json
|
36 | {
|
37 | "plugins": ["transform-es3-property-literals"]
|
38 | }
|
39 | ```
|
40 |
|
41 | ### Via CLI
|
42 |
|
43 | ```sh
|
44 | babel --plugins transform-es3-property-literals script.js
|
45 | ```
|
46 |
|
47 | ### Via Node API
|
48 |
|
49 | ```javascript
|
50 | require("babel-core").transform("code", {
|
51 | plugins: ["transform-es3-property-literals"]
|
52 | });
|
53 | ```
|