lib/utils.js
function FREEZE(obj, all = false) {
		if (UoN(obj)) return obj;
		// ----------------------------------------------------------
		let iss = ISS(obj), iEN = OoA.has(iss), dfl, res;
		// ----------------------------------------------------------
			if (!iEN||iss=='function') return obj;
			if (!!obj.toJS) obj = obj.toJS();
			if (ISCONFIG(obj)||ISPTYPE(obj)) return obj;
		// ----------------------------------------------------------
			dfl = [{},[]][-(-(iss==OoA[1]))];
			res = Assign(dfl, obj);
		// ----------------------------------------------------------
			if (!!all) res = FromJS(res).map((v)=>(
				FREEZE(v, all)
			)).toJS();
		// ----------------------------------------------------------
			return Object.freeze(res);
	}
function FREEZE(obj, all = false) {
		if (UoN(obj)) return obj;
		// ----------------------------------------------------------
		let iss = ISS(obj), iEN = OoA.has(iss), dfl, res;
		// ----------------------------------------------------------
			if (!iEN||iss=='function') return obj;
			if (!!obj.toJS) obj = obj.toJS();
			if (ISCONFIG(obj)||ISPTYPE(obj)) return obj;
		// ----------------------------------------------------------
			dfl = [{},[]][-(-(iss==OoA[1]))];
			res = Assign(dfl, obj);
		// ----------------------------------------------------------
			if (!!all) res = FromJS(res).map((v)=>(
				FREEZE(v, all)
			)).toJS();
		// ----------------------------------------------------------
			return Object.freeze(res);
	}
function FREEZE ( obj , all = false ) { if ( UoN ( obj ) ) return obj ; // ---------------------------------------------------------- let iss = ISS ( obj ) , iEN = OoA . has ( iss ) , dfl , res ; // ---------------------------------------------------------- if ( ! iEN || iss == 'function' ) return obj ; if ( ! ! obj . toJS ) obj = obj . toJS ( ) ; if ( ISCONFIG ( obj ) || ISPTYPE ( obj ) ) return obj ; // ---------------------------------------------------------- dfl = [ { } , [ ] ] [ - ( - ( iss == OoA [ 1 ] ) ) ] ; res = Assign ( dfl , obj ) ; // ---------------------------------------------------------- if ( ! ! all ) res = FromJS ( res ) . map ( ( v ) => ( FREEZE ( v , all ) ) ) . toJS ( ) ; // ---------------------------------------------------------- return Object . freeze ( res ) ; }
Freeze an Object, if needed.

@param {*} obj The Object to Freeze
@param {Boolean} [all=false] `true`, if Freezing should be recursive
@returns {Object} The frozen Object
@private
Freeze an Object if needed .