1. 首页
  2. 考试认证
  3. 其它
  4. split keys 公开逗号分隔的键以分隔属性

split keys 公开逗号分隔的键以分隔属性

上传者: 2024-10-04 22:07:36上传 ZIP文件 3.79KB 热度 7次
拆分键在对象中优雅地声明属性别名。 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
下载地址
用户评论