src/defineReact.js
function clone(frm, to) {
	if (frm === null || typeof frm !== "object") {
		return frm;
	}
	if (frm.constructor !== Object && frm.constructor !== Array) {
		return frm;
	}
	if (frm.constructor === Date || frm.constructor === RegExp || frm.constructor === Function ||
		frm.constructor === String || frm.constructor === Number || frm.constructor === Boolean) {
		return new frm.constructor(frm);
	}
	to = to || new frm.constructor();
	for (var name in frm) {
		to[name] = typeof to[name] === "undefined" ? clone(frm[name], null) : to[name];
	}
	return to;
}
function clone(frm, to) {
	if (frm === null || typeof frm !== "object") {
		return frm;
	}
	if (frm.constructor !== Object && frm.constructor !== Array) {
		return frm;
	}
	if (frm.constructor === Date || frm.constructor === RegExp || frm.constructor === Function ||
		frm.constructor === String || frm.constructor === Number || frm.constructor === Boolean) {
		return new frm.constructor(frm);
	}
	to = to || new frm.constructor();
	for (var name in frm) {
		to[name] = typeof to[name] === "undefined" ? clone(frm[name], null) : to[name];
	}
	return to;
}
function clone ( frm , to ) { if ( frm === null || typeof frm !== "object" ) { return frm ; } if ( frm . constructor !== Object && frm . constructor !== Array ) { return frm ; } if ( frm . constructor === Date || frm . constructor === RegExp || frm . constructor === Function || frm . constructor === String || frm . constructor === Number || frm . constructor === Boolean ) { return new frm . constructor ( frm ) ; } to = to || new frm . constructor ( ) ; for ( var name in frm ) { to [ name ] = typeof to [ name ] === "undefined" ? clone ( frm [ name ] , null ) : to [ name ] ; } return to ; }
this is utilized by some of the global state functionality in order to get a clone that will not continue to be modified as the GlobalState mutates
this is utilized by some of the global state functionality in order to get a clone that will not continue to be modified as the GlobalState mutates