Skip to content

Commit

Permalink
Re-ordered filter function list to match LoDash Readme.md, removed so…
Browse files Browse the repository at this point in the history
…me of the filters because those made 'no sense' atm.
  • Loading branch information
RopoMen committed Aug 13, 2015
1 parent 30bdde2 commit e07e836
Show file tree
Hide file tree
Showing 2 changed files with 48 additions and 44 deletions.
85 changes: 47 additions & 38 deletions angular-lodash.js
Original file line number Diff line number Diff line change
Expand Up @@ -86,58 +86,67 @@

// begin register ropooy-angular-lodash/filters

var adapList = [
var filterList = [
// Arrays
'compact',
'difference',
['rest', 'drop', 'tail'],
['first', 'head', 'take'],
'flatten',
'indexOf',
'initial',
'intersection',
'last',
'lastIndexOf',
['zipObject', 'object'],
'sortedIndex',
'union',
['uniq', 'unique'],
['zip', 'unzip'],
'without',
'xor',

//Chaining, had 'tap', but it is removed now.

//Collections, had 'reduce'/'reduceRight'+aliases but those are removed now.
'at',
['map', 'collect'],
['reduce', 'inject', 'foldl'],
['reduceRight', 'foldr'],
['find', 'detect'],
'countBy',
['find', 'detect', 'findWhere'],
['filter', 'select'],
'where',
'findWhere',
'reject',
'findLast',
'groupBy',
'invoke',
'pluck',
'max',
'min',
'sortBy',
'groupBy',
'countBy',
'pluck',
'reject',
'shuffle',
'toArray',
'has',
'size',
['first', 'head', 'take'],
'initial',
'last',
['rest', 'tail', 'drop'],
'compact',
'flatten',
'without',
'union',
'intersection',
'difference',
['uniq', 'unique'],
'zip',
'object',
'indexOf',
'lastIndexOf',
'sortedIndex',
'sortBy',
'toArray',
'where',

//Functions, none

//Objects
['functions', 'methods'],
'invert',
'keys',
'values',
'omit',
'pairs',
'invert',
['functions', 'methods'],
'pick',
'omit',
'tap',
'identity',
'uniqueId',
'values',

//Utilities, 'template' has been removed.
'escape',
'identity',
'result',
'template'
'unescape',
'uniqueId'
];

_.each(adapList, function(filterNames) {
_.each(filterList, function(filterNames) {
if(!(_.isArray(filterNames))) {
filterNames = [filterNames];
}
Expand Down
7 changes: 1 addition & 6 deletions test/filterSpec.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,6 @@ describe('ropooy-angular-lodash: Filter', function() {

var simpleAdapList = [
'map', 'collect',
'reduce', 'inject', 'foldl',
'reduceRight', 'foldr',
'find', 'detect',
'invoke',
'pluck',
Expand All @@ -42,12 +40,9 @@ describe('ropooy-angular-lodash: Filter', function() {
'values',
'functions', 'methods',
'pick',
'tap',
'has',
'uniqueId',
'escape',
'result',
'template'
'result'
];

var $filter;
Expand Down

0 comments on commit e07e836

Please sign in to comment.