split keys 公开逗号分隔的键以分隔属性
拆分键在对象中优雅地声明属性别名。 Split-keys在对象中拆分逗号分隔的键,并为每个键创建属性别名。前: var a = { tx : { tta : 1 , ttb : 1 t} } ; //create alias a . y = a . x ;后: //declare list of aliases var a = splitKeys ( { t'x, y' : { tta : 1 , ttb : 1 t} } ) ;用$ npm install split-keys var splitKeys = require ( 'split-keys' ) ; var obj = splitKeys ( { t'a, b' : function ( ) { } } ) ; obj . a === obj . b //true应用程序接口splitKeys
下载地址
用户评论