static unfreeze()

in lib/modeling/immutability.ts [23:35]


	static unfreeze<T>(obj:Readonly<T>):T{
		if (Object(obj) !== obj || obj instanceof Date || obj instanceof RegExp || obj instanceof Function)
			return obj;

		let unfrozenObj:T = Object.create(obj.constructor.prototype);
		Object.assign(unfrozenObj, obj);

		Object.getOwnPropertyNames(obj).forEach(prop => {
			unfrozenObj[<keyof T>prop] = Immutability.unfreeze(unfrozenObj[<keyof T>prop]);
		});

		return unfrozenObj;
	}