Sha256: 0622f205617ed220f1094787ea54b417902e11626e57d00498984cc0b196d941

Contents?: true

Size: 737 Bytes

Versions: 16

Compression:

Stored size: 737 Bytes

Contents

'use strict';

var Utils = Utils || {};

Utils.arrayHelpers = {
  removeItem: function(collection, findIdxFn) {
    var itemIdx = _.findIndex(collection, findIdxFn)
    collection.splice(itemIdx, 1);
    return collection;
  },
  compare: function compare(left, right, iteratee) {
    return (left.length === right.length) &&
        _.every(left, function(leftItem) {
          return _.some(right, function(rightItem) {
            if (_.exists(iteratee)) {
              return iteratee(leftItem) === iteratee(rightItem);
            } else {
              return leftItem === rightItem;
            }
          });
        });
  }
};

Utils.stringHelpers = {
  isPresent: function(str) {
    return !(str||'').match(/^\s*$/);
  }
};

Version data entries

16 entries across 16 versions & 1 rubygems

Version Path
aleph_analytics-0.4.9.pre.dev app/assets/javascripts/lib/utils.js
aleph_analytics-0.4.8 app/assets/javascripts/lib/utils.js
aleph_analytics-0.4.7 app/assets/javascripts/lib/utils.js
aleph_analytics-0.4.4 app/assets/javascripts/lib/utils.js
aleph_analytics-0.4.2 app/assets/javascripts/lib/utils.js
aleph_analytics-0.4.1 app/assets/javascripts/lib/utils.js
aleph_analytics-0.3.0 app/assets/javascripts/lib/utils.js
aleph_analytics-0.2.0 app/assets/javascripts/lib/utils.js
aleph_analytics-0.1.0 app/assets/javascripts/lib/utils.js
aleph_analytics-0.0.6 app/assets/javascripts/lib/utils.js
aleph_analytics-0.0.5 app/assets/javascripts/lib/utils.js
aleph_analytics-0.0.4 app/assets/javascripts/lib/utils.js
aleph_analytics-0.0.3 app/assets/javascripts/lib/utils.js
aleph_analytics-0.0.2 app/assets/javascripts/lib/utils.js
aleph_analytics-0.0.1.alpha app/assets/javascripts/lib/utils.js
aleph_analytics-0.0.0.alpha app/assets/javascripts/lib/utils.js