1 /** 2 * com.sekati.utils.ObjectUtils 3 * @version 1.0.1 4 * @author jason m horwitz | sekati.com 5 * Copyright (C) 2007 jason m horwitz, Sekat LLC. All Rights Reserved. 6 * Released under the MIT License: http://www.opensource.org/licenses/mit-license.php 7 */ 8 9 /** 10 * Object cloning utility. 11 */ 12 class com.sekati.utils.Clone { 13 14 /** 15 * Create a cloned object thru recursively coping of contents 16 * @param o (Object) to be cloned 17 * @return Object 18 */ 19 public static function create(o:Object):Object { 20 var obj:Object = new Object( ); 21 var itype:Object; 22 for(var i in o) { 23 itype = typeof(o[i]); 24 obj[i] = (itype == "object" || itype == "array") ? Clone.create( o[i] ) : o[i]; 25 } 26 return obj; 27 } 28 29 private function Clone() { 30 } 31 }