文件名称:tcomb-decorators:ES7装饰用tcomb
文件大小:8KB
文件格式:ZIP
更新时间:2024-05-21 00:01:02
JavaScript
tcomb-decorators ES7装饰的 。 安装 npm install tcomb-decorators --save 用法 @func import { func } from 'tcomb-decorators' ; import { String as Str } from 'tcomb' ; class SomeClass { @ func ( [ Str ] , Str ) someFunc ( value ) { return value + 'World' ; } } const instance = new SomeClass ( ) ; instance . someFunc ( 'Hello ' ) ; // Works instance . someFunc ( null ) ; // Throws error @
【文件预览】:
tcomb-decorators-master
----.eslintrc(9KB)
----.babelrc(17B)
----package.json(965B)
----test()
--------index.js(2KB)
----LICENSE(1KB)
----src()
--------struct.js(546B)
--------index.js(84B)
--------func.js(234B)
----.npmignore(42B)
----webpack.config.babel.js(412B)
----.gitignore(42B)
----README.md(1KB)
----.eslintignore(50B)
----.editorconfig(63B)