2014-10-10 02:22:38 +00:00
|
|
|
var has_buf = (typeof Buffer !== 'undefined');
|
2015-04-02 20:32:22 +00:00
|
|
|
|
|
|
|
function cc2str(arr) {
|
|
|
|
var o = "";
|
|
|
|
for(var i = 0; i != arr.length; ++i) o += String.fromCharCode(arr[i]);
|
|
|
|
return o;
|
|
|
|
}
|
2017-02-03 20:50:45 +00:00
|
|
|
|
|
|
|
function dup(o/*:object*/)/*:object*/ {
|
|
|
|
if(typeof JSON != 'undefined') return JSON.parse(JSON.stringify(o));
|
|
|
|
if(typeof o != 'object' || !o) return o;
|
|
|
|
var out = {};
|
|
|
|
for(var k in o) if(o.hasOwnProperty(k)) out[k] = dup(o[k]);
|
|
|
|
return out;
|
|
|
|
}
|