【文件属性】:
文件名称:describe-property:使用 ES5 默认值快速定义 JavaScript 对象属性
文件大小:4KB
文件格式:ZIP
更新时间:2021-06-30 06:55:09
JavaScript
是一个在 node.js 和浏览器中运行的属性描述符库。 您可以使用它来快速生成与 、 和/或一起使用的属性描述符。
例子
var d = require ( 'describe-property' ) ;
function Person ( firstName , surname ) {
this . firstName = firstName ;
this . surname = surname ;
}
Object . defineProperties ( Person . prototype , {
// Methods can be passed directly.
sayHi : d ( function ( ) {
console . log ( 'Hello, my name is' , this . fullName ) ;
} ) ,
【文件预览】:
describe-property-master
----.travis.yml(38B)
----.jshintignore(13B)
----index.js(618B)
----package.json(798B)
----tests()
--------function-test.js(672B)
--------gs-test.js(1KB)
----.npmignore(42B)
----README.md(3KB)
----.jshintrc(21B)