函数元数据缓存
function cached(fn) { var cache = Object.creat(null) return (function cachedFn(str){ var hit = cache[str] return hit || (cache[str] = fn(str)) }) }
Camelize a hyphen-delimited string
var camelizeRE = /-(w)/g var camelize = cached(function(str){ return str.replace(camelizeRE, function(_, c){return c ? c.toUpperCase() : ''}) })