Sindbad~EG File Manager

Current Path : /home/infinitibizsol/insurcrm.infinitibizsol.com/node_modules/underscore/amd/
Upload File :
Current File : /home/infinitibizsol/insurcrm.infinitibizsol.com/node_modules/underscore/amd/sortBy.js

define(['./_cb', './pluck', './map'], function (_cb, pluck, map) {

  // Sort the object's values by a criterion produced by an iteratee.
  function sortBy(obj, iteratee, context) {
    var index = 0;
    iteratee = _cb(iteratee, context);
    return pluck(map(obj, function(value, key, list) {
      return {
        value: value,
        index: index++,
        criteria: iteratee(value, key, list)
      };
    }).sort(function(left, right) {
      var a = left.criteria;
      var b = right.criteria;
      if (a !== b) {
        if (a > b || a === void 0) return 1;
        if (a < b || b === void 0) return -1;
      }
      return left.index - right.index;
    }), 'value');
  }

  return sortBy;

});

Sindbad File Manager Version 1.0, Coded By Sindbad EG ~ The Terrorists