【文件属性】:
文件名称:DecorateThis:JS装饰器库
文件大小:61KB
文件格式:ZIP
更新时间:2021-05-31 20:27:52
JavaScript
装饰这个
通过 ES7 装饰器和其他一些装饰器进行简单的普通 JS 类型检查,以启动。
文档
如果您喜欢这个项目,请务必查看 ,它是不变的Flux框架。
类型验证
当提供或从类或对象函数返回意外类型时抛出错误。 有关更多详细信息,请参阅类型验证器 API 。
import { param , returns } from 'decorate-this' ;
class Point {
constructor ( ) {
this . x = 0 ;
this . y = 0 ;
}
// The first param of this method takes a Point, and will throw
// a type error if a non-Point is passed
@ param (
【文件预览】:
DecorateThis-master
----.eslintrc(1KB)
----webpack.config.js(774B)
----src()
--------properties.es6.js(377B)
--------collection-defs.es6.js(2KB)
--------promises.es6.js(781B)
--------weak-composite-key-map.es6.js(731B)
--------typedefs.es6.js(2KB)
--------debounce.es6.js(576B)
--------returns.es6.js(549B)
--------validator.es6.js(2KB)
--------memoize.es6.js(530B)
--------curry.es6.js(790B)
--------param.es6.js(1KB)
--------entry()
----.npmignore(14B)
----.travis.yml(171B)
----gulpfile.js(5KB)
----LICENSE(11KB)
----test()
--------server.js(434B)
--------fixtures()
--------notifications()
--------tests()
--------entry()
----README.md(3KB)
----docs()
--------TYPE_VALIDATOR_API.md(6KB)
--------CHANGELOG.md(1KB)
----.gitignore(656B)
----bin()
--------publish.sh(177B)
----package.json(1KB)