(name)
| 13974 | |
| 13975 | //把字符串中的对象拆分成 对象比如 data.object.info.age 变成对象{object:true,info:true,age:true} 返回出去 |
| 13976 | function parseModifiers(name) { |
| 13977 | // 匹配以点开头的分组 不属于点 data.object.info.age 匹配到 ['.object','.info' , '.age'] |
| 13978 | var match = name.match(modifierRE); |
| 13979 | if (match) { |
| 13980 | var ret = {}; |
| 13981 | match.forEach(function (m) { |
| 13982 | ret[m.slice(1)] = true; //去除点,丢弃第一位。 把他变成对象{object:true,info:true,age:true} |
| 13983 | }); |
| 13984 | return ret |
| 13985 | } |
| 13986 | } |
| 13987 | |
| 13988 | /* |
| 13989 | 把数组对象转换成 对象 例如 |