In this case something like
var str = ".cssRule { value: 'foo'; }";
someArray.push(
( (str.replace(/.|}|;/g,''))
.split(/{/)
.join(':"')
.replace(/s/g,'')
.replace(/.$/,'"')
);
/* =>"[cssRule:"value:'foo'"] */
would work. I don't think it's very generic though.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…