遍历对象操作

@ignore
@param {Object} obj 目标对象
@param {Function} fn 遍历操作
187950
function eachObject(obj, fn) {
                for (var k in obj) {
                    hasOwn(obj, k) && fn(obj[k], k, obj);
                }
                // ie6-8 enum bug
                if (hasEnumBug) {
                    for (var i = enumProperties.length - 1; i > -1; --i) {
                        var key = enumProperties[i];
                        hasOwn(obj, key) && fn(obj[key], key, obj);
                    }
                }
            }
680338
function forIn(object, fn, scope) {
    var symbols,
        k,
        i,
        l;

    for (k in object)
      fn.call(scope || null, k, object[k]);

    if (Object.getOwnPropertySymbols) {
      symbols = Object.getOwnPropertySymbols(object);

      for (i = 0, l = symbols.length; i < l; i++)
        fn.call(scope || null, symbols[i], object[symbols[i]]);
    }
  }
447692
function _fnGetPos ( obj )
	{
		var iLeft = 0;
		var iTop = 0;

		if (obj.offsetParent)
		{
			iLeft = obj.offsetLeft;
			iTop = obj.offsetTop;
			obj = obj.offsetParent;
			while (obj)
			{
				iLeft += obj.offsetLeft;
				iTop += obj.offsetTop;
				obj = obj.offsetParent;
			}
		}
		return [iLeft,iTop];
	}
638808
function(/* objs */){
      var dest = _.some(arguments) ? {} : null;

      if (truthy(dest)) {
        _.extend.apply(null, concat.call([dest], _.toArray(arguments)));
      }

      return dest;
    }
204272
function objectToFunction(obj) {
  var match = {};
  for (var key in obj) {
    match[key] = typeof obj[key] === 'string'
      ? defaultToFunction(obj[key])
      : toFunction(obj[key]);
  }
  return function(val){
    if (typeof val !== 'object') return false;
    for (var key in match) {
      if (!(key in val)) return false;
      if (!match[key](val[key])) return false;
    }
    return true;
  };
}
380679
function checkInterface(obj, funcs) {
    for (var i = 0; i < funcs.length; ++i) {
        if (typeof obj[funcs[i]] !== 'function')
            return false;
    }
    return true;
}
950129
function format(obj, opts, fn) {
  if (typeof opts === 'function') {
    fn = opts; opts = {};
  }

  opts = opts || {};
  if (Array.isArray(opts.filter) || typeof opts.filter === 'string') {
    obj = filter(obj, opts.filter);
  }

  var keys = Object.keys(obj);
  var len = keys.length, i = 0;
  var str = '';
  var total = len;

  while (len--) {
    var fp = keys[i++];
    var ctx = context(read(fp), fn);
    var name = basename(fp);
    str += heading(name, fp);

    var list = obj[fp];
    var methods = Object.keys(list);
    total += methods.length;

    str += listify(fp, methods, ctx);
  }

  var res = {};
  res.list = str;
  res.total = total;
  return res;
}
210132
function (obj) {
	var fns = {},
		i;
	for (i in obj) {
		fns[i] = hogan.compile( obj[i] );
	}
	return fns;
}
432312
function string(obj, fn) {
  for (var i = 0; i < obj.length; ++i) {
    fn(obj.charAt(i), i);
  }
}
19926
function(fn, obj) {
            for (var p=0;p<me.pages.length;++p) {
                var cal = me.pages[p];
                cal[this.type + strEvent].unsubscribe(fn, obj);
            }
        }
802888
function string(obj, fn, ctx) {
  for (var i = 0; i < obj.length; ++i) {
    fn.call(ctx, obj.charAt(i), i);
  }
}
1116911
function array(obj, fn, ctx) {
  for (var i = 0; i < obj.length; ++i) {
    fn.call(ctx, obj[i], i);
  }
}
560156
function applyKey (fn, key) {
    return function (obj) {
      if (key in obj) {
        obj[key] = fn(obj[key])
      }

      return obj
    }
  }
903597
function parseOBJ(obj,fn) {   // http://en.wikipedia.org/wiki/Wavefront_.obj_file
   var l = obj.split(/\n/);
   var v = [], f = [];
   
   for(var i=0; i<l.length; i++) {
      var s = l[i];
      var a = s.split(/\s+/);

      if(a[0]=='v') {
         v.push([a[1],a[2],a[3]]);
         
      } else if(a[0]=='f') {
         var fc = [];
         var skip = 0;

         for(var j=1; j<a.length; j++) {
            var c = a[j];            
            c = c.replace(/\/.*$/,'');     // -- if coord# is '840/840' -> 840
            c--;                       // -- starts with 1, but we start with 0
            if(c>=v.length) 
               skip++;
            if(skip==0)
               fc.push(c);
         }
         //fc.reverse();
         if(skip==0) 
            f.push(fc);
         
      } else {
         ;     // vn vt and all others disregarded
      }
   }
   var src = ""; 
   src += "// producer: OpenJSCAD Compatibility ("+version().join('.')+") Wavefront OBJ Importer\n";
   src += "// date: "+(new Date())+"\n";
   src += "// source: "+fn+"\n";
   src += "\n";
   //if(err) src += "// WARNING: import errors: "+err+" (some triangles might be misaligned or missing)\n";
   src += "// objects: 1\n// object #1: polygons: "+f.length+"\n\n";
   src += "function main() { return "; 
   src += vt2jscad(v,f);
   src += "; }";
   return src;
}
855374
function mapObject(obj, fn) {
  if (typeof obj !== 'object') {
    throw new Error('Expected an object as the first argument');
  }

  if (typeof fn !== 'function') {
    throw new Error('Expected second argument to be a function');
  }

  const keys = Object.keys(obj);
  const mappedObj = {};
  for (const key of keys) {
    mappedObj[key] = fn(obj[key], key);
  }
  return mappedObj;
}
1175935
function ( obj ) {
            var n;
            for ( n in obj ) {
                if ( _dom[n] ) {
                    throw new Error( '[ixBand] Extend Error : ixBand에 "' + n + '" Method가 이미 존재합니다.' );
                } else {
                    _dom[n] = obj[n];
                }
            }
        }
1205998
function destroy(obj) {
    for (var i in obj) {
        if (obj.hasOwnProperty(i) && obj[i]) {
            if ($.isArray(obj[i])) {
                obj[i].length = 0;
            }
            if ($.isFunction(obj[i].destroy)) {
                obj[i].destroy();
            }
            delete obj[i];
        }
    }
}