1.1.2 • Published 7 years ago

babel-plugin-annotation-to-prop v1.1.2

Weekly downloads
3
License
MIT
Repository
github
Last release
7 years ago

babel-plugin-annotation-to-prop

make annotation of function in class to class static properties

class YourClass {
	/**
	 * constructor
	 * @prop1: strValue1
	 */
	constructor() {
		//super();
	}
	
	/**
	 * actionView 
	 * @test1: false
	 * @test2: GET
	 * @test3: 123
	 */
	actionView() {
		//something
	}
}

export default YourClass;

to this

...

YourClass.prop1 = "strValue1";
YourClass.actionView={};
YourClass.actionView.test1 = false;
YourClass.actionView.test2 = "GET";
YourClass.actionView.test3 = 123;
export["default"] = YourClass;

Install

$ npm install babel-plugin-annotation-to-prop --save-dev

Usage for your .babelrc

{
	"env": {
		"dev": {
			"plugins": [
				"annotation-to-prop"
			]
		}
	}
}
1.1.2

7 years ago

1.1.1

7 years ago

1.1.0

7 years ago

1.0.1

8 years ago

1.0.0

8 years ago

0.1.0

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago