ampersand-collection-lodash-mixin
Advanced tools
Comparing version 2.0.1 to 3.0.0
/*$AMPERSAND_VERSION*/ | ||
var isFunction = require('lodash.isfunction'); | ||
var isFunction = require('lodash/isfunction'); | ||
var _ = { | ||
countBy: require('lodash.countby'), | ||
difference: require('lodash.difference'), | ||
drop: require('lodash.drop'), | ||
each: require('lodash.foreach'), | ||
every: require('lodash.every'), | ||
filter: require('lodash.filter'), | ||
find: require('lodash.find'), | ||
forEach: require('lodash.foreach'), | ||
groupBy: require('lodash.groupby'), | ||
includes: require('lodash.includes'), | ||
indexBy: require('lodash.indexby'), | ||
indexOf: require('lodash.indexof'), | ||
initial: require('lodash.initial'), | ||
invoke: require('lodash.invoke'), | ||
isEmpty: require('lodash.isempty'), | ||
lastIndexOf: require('lodash.lastindexof'), | ||
map: require('lodash.map'), | ||
max: require('lodash.max'), | ||
min: require('lodash.min'), | ||
partition: require('lodash.partition'), | ||
reduce: require('lodash.reduce'), | ||
reduceRight: require('lodash.reduceright'), | ||
reject: require('lodash.reject'), | ||
rest: require('lodash.rest'), | ||
sample: require('lodash.sample'), | ||
shuffle: require('lodash.shuffle'), | ||
some: require('lodash.some'), | ||
sortBy: require('lodash.sortby'), | ||
take: require('lodash.take'), | ||
without: require('lodash.without') | ||
countBy: require('lodash/countBy'), | ||
difference: require('lodash/difference'), | ||
drop: require('lodash/drop'), | ||
each: require('lodash/forEach'), | ||
every: require('lodash/every'), | ||
filter: require('lodash/filter'), | ||
find: require('lodash/find'), | ||
forEach: require('lodash/forEach'), | ||
groupBy: require('lodash/groupBy'), | ||
includes: require('lodash/includes'), | ||
indexBy: require('lodash/keyBy'), | ||
indexOf: require('lodash/indexOf'), | ||
initial: require('lodash/initial'), | ||
invoke: require('lodash/invokeMap'), | ||
invokeMap: require('lodash/invokeMap'), | ||
isEmpty: require('lodash/isEmpty'), | ||
lastIndexOf: require('lodash/lastIndexOf'), | ||
keyBy: require('lodash/keyBy'), | ||
map: require('lodash/map'), | ||
max: require('lodash/max'), | ||
min: require('lodash/min'), | ||
partition: require('lodash/partition'), | ||
reduce: require('lodash/reduce'), | ||
reduceRight: require('lodash/reduceRight'), | ||
reject: require('lodash/reject'), | ||
rest: require('lodash/tail'), | ||
sample: require('lodash/sample'), | ||
shuffle: require('lodash/shuffle'), | ||
some: require('lodash/some'), | ||
sortBy: require('lodash/sortBy'), | ||
tail: require('lodash/tail'), | ||
take: require('lodash/take'), | ||
without: require('lodash/without') | ||
}; | ||
@@ -41,5 +44,5 @@ var slice = [].slice; | ||
var methods = ['forEach', 'each', 'map', 'reduce', 'reduceRight', 'find', | ||
'filter', 'reject', 'every', 'some', 'includes', 'invoke', 'max', 'min', | ||
'take', 'initial', 'rest', 'drop', 'without', 'difference', 'indexOf', 'shuffle', | ||
'lastIndexOf', 'isEmpty', 'sample', 'partition' | ||
'filter', 'reject', 'every', 'some', 'includes', 'invoke', 'invokeMap', | ||
'max', 'min', 'take', 'initial', 'rest', 'drop', 'without', 'difference', | ||
'indexOf', 'shuffle', 'lastIndexOf', 'isEmpty', 'sample', 'partition', 'tail' | ||
]; | ||
@@ -58,3 +61,3 @@ | ||
// lodash methods that take a property name as an argument. | ||
var attributeMethods = ['groupBy', 'countBy', 'sortBy', 'indexBy']; | ||
var attributeMethods = ['groupBy', 'countBy', 'sortBy', 'indexBy', 'keyBy']; | ||
@@ -61,0 +64,0 @@ // Use attributes instead of properties. |
{ | ||
"name": "ampersand-collection-lodash-mixin", | ||
"description": "A mixin for extending ampersand-collection with lodash methods.", | ||
"version": "2.0.1", | ||
"version": "3.0.0", | ||
"author": "Henrik Joreteg <henrik@andyet.net>", | ||
@@ -16,44 +16,12 @@ "browserify": { | ||
"ampersand-version": "^1.0.0", | ||
"lodash.countby": "^3.1.0", | ||
"lodash.difference": "^3.1.0", | ||
"lodash.drop": "^3.0.0", | ||
"lodash.every": "^3.2.0", | ||
"lodash.filter": "^3.1.0", | ||
"lodash.find": "^3.2.0", | ||
"lodash.foreach": "^3.0.2", | ||
"lodash.groupby": "^3.1.0", | ||
"lodash.includes": "^3.1.0", | ||
"lodash.indexby": "^3.1.0", | ||
"lodash.indexof": "^3.0.2", | ||
"lodash.initial": "^3.0.0", | ||
"lodash.invoke": "^3.1.0", | ||
"lodash.isempty": "^3.0.1", | ||
"lodash.isfunction": "^3.0.2", | ||
"lodash.lastindexof": "^3.0.2", | ||
"lodash.map": "^3.1.0", | ||
"lodash.max": "^3.2.0", | ||
"lodash.min": "^3.2.0", | ||
"lodash.partition": "^3.1.0", | ||
"lodash.reduce": "^3.1.0", | ||
"lodash.reduceright": "^3.1.0", | ||
"lodash.reject": "^3.1.0", | ||
"lodash.rest": "^3.0.0", | ||
"lodash.sample": "^3.0.0", | ||
"lodash.shuffle": "^3.0.0", | ||
"lodash.some": "^3.2.0", | ||
"lodash.sortby": "^3.1.0", | ||
"lodash.take": "^3.0.0", | ||
"lodash.without": "^3.1.0" | ||
"lodash": "^4.11.1" | ||
}, | ||
"devDependencies": { | ||
"ampersand-collection": "^1.0.0", | ||
"ampersand-state": "^4.3.2", | ||
"browserify": "^9.0.4", | ||
"ampersand-state": "^5.0.1", | ||
"jshint": "^2.5.5", | ||
"phantomjs": "^1.9.7-15", | ||
"precommit-hook": "^2.0.1", | ||
"run-browser": "^2.0.2", | ||
"tap-spec": "^2.2.2", | ||
"tape": "^3.5.0", | ||
"tape-run": "^1.0.0" | ||
"phantomjs": "^2.1.7", | ||
"precommit-hook": "^3.0.0", | ||
"tape": "^4.5.1", | ||
"zuul": "^3.9.0" | ||
}, | ||
@@ -74,6 +42,8 @@ "homepage": "https://github.com/ampersandjs/ampersand-collection-lodash-mixin", | ||
"scripts": { | ||
"test": "browserify test/index.js | tape-run | tap-spec", | ||
"start": "zuul --local -- test/index.js", | ||
"test": "zuul --phantom -- test/index.js", | ||
"test-ci": "zuul -- test/index.js", | ||
"lint": "jshint .", | ||
"start": "run-browser test/index.js", | ||
"list": "node -e \"console.log(Object.keys(require('./ampersand-collection-lodash-mixin')).sort().join(', '))\"" | ||
"list": "node -e \"console.log(Object.keys(require('./ampersand-collection-lodash-mixin')).sort().join(', '))\"", | ||
"validate": "npm ls" | ||
}, | ||
@@ -83,19 +53,3 @@ "pre-commit": [ | ||
"test" | ||
], | ||
"testling": { | ||
"files": "test/*.js", | ||
"browsers": [ | ||
"ie/9..latest", | ||
"firefox/17..latest", | ||
"firefox/nightly", | ||
"chrome/22..latest", | ||
"chrome/canary", | ||
"opera/12..latest", | ||
"opera/next", | ||
"safari/5.1..latest", | ||
"ipad/6.0..latest", | ||
"iphone/6.0..latest", | ||
"android-browser/4.2..latest" | ||
] | ||
} | ||
] | ||
} |
@@ -15,5 +15,6 @@ # ampersand-collection-lodash-mixin | ||
countBy, difference, drop, each, every, filter, find, findWhere, first, | ||
forEach, groupBy, includes, indexBy, indexOf, initial, invoke, isEmpty, last, | ||
lastIndexOf, map, max, min, partition, pluck, reduce, reduceRight, reject, | ||
rest, sample, shuffle, size, some, sortBy, take, where, without | ||
forEach, groupBy, includes, indexBy, indexOf, initial, invoke, invokeMap, | ||
isEmpty, keyBy, last, lastIndexOf, map, max, min, partition, pluck, reduce, | ||
reduceRight, reject, rest, sample, shuffle, size, some, sortBy, take, | ||
tail, where, without | ||
``` | ||
@@ -20,0 +21,0 @@ |
@@ -5,3 +5,3 @@ var test = require('tape'); | ||
var AmpersandLodashMixins = require('../ampersand-collection-lodash-mixin'); | ||
var without = require('lodash.without'); | ||
var without = require('lodash/without'); | ||
var collection; | ||
@@ -23,7 +23,7 @@ | ||
'reduceRight', 'find', 'filter', | ||
'reject', 'every', 'some', 'includes', 'invoke', | ||
'max', 'min', 'size', 'first', 'take', 'initial', 'rest', | ||
'reject', 'every', 'some', 'includes', 'invoke', 'invokeMap', | ||
'max', 'min', 'size', 'first', 'take', 'initial', 'rest', 'tail', | ||
'drop', 'last', 'without', 'difference', 'indexOf', 'shuffle', | ||
'lastIndexOf', 'isEmpty', 'sample', 'partition', | ||
'groupBy', 'countBy', 'sortBy', 'indexBy' | ||
'groupBy', 'countBy', 'sortBy', 'indexBy', 'keyBy' | ||
]; | ||
@@ -43,3 +43,3 @@ | ||
]); | ||
without(methods, 'groupBy', 'countBy', 'sortBy', 'indexBy').forEach(function (method) { | ||
without(methods, 'groupBy', 'countBy', 'sortBy', 'indexBy', 'keyBy').forEach(function (method) { | ||
t.doesNotThrow(function () { collection[method](); }, method + ' should be callable'); | ||
@@ -50,3 +50,3 @@ }); | ||
test('groupBy, countBy, sortBy, indexBy should be callable on the collection instance', function (t) { | ||
test('groupBy, countBy, sortBy, indexBy, keyBy should be callable on the collection instance', function (t) { | ||
var collection = new Collection([ | ||
@@ -56,3 +56,3 @@ { id: 1, foo: 'baz', bar: 'baz' }, | ||
]); | ||
['groupBy', 'countBy', 'sortBy', 'indexBy'].forEach(function (method) { | ||
['groupBy', 'countBy', 'sortBy', 'indexBy', 'keyBy'].forEach(function (method) { | ||
t.doesNotThrow(function () { | ||
@@ -59,0 +59,0 @@ collection[method]('foo'); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
2
7
11
61
14915
235
+ Addedlodash@^4.11.1
+ Addedlodash@4.17.21(transitive)
- Removedlodash.countby@^3.1.0
- Removedlodash.difference@^3.1.0
- Removedlodash.drop@^3.0.0
- Removedlodash.every@^3.2.0
- Removedlodash.filter@^3.1.0
- Removedlodash.find@^3.2.0
- Removedlodash.foreach@^3.0.2
- Removedlodash.groupby@^3.1.0
- Removedlodash.includes@^3.1.0
- Removedlodash.indexby@^3.1.0
- Removedlodash.indexof@^3.0.2
- Removedlodash.initial@^3.0.0
- Removedlodash.invoke@^3.1.0
- Removedlodash.isempty@^3.0.1
- Removedlodash.isfunction@^3.0.2
- Removedlodash.lastindexof@^3.0.2
- Removedlodash.map@^3.1.0
- Removedlodash.max@^3.2.0
- Removedlodash.min@^3.2.0
- Removedlodash.partition@^3.1.0
- Removedlodash.reduce@^3.1.0
- Removedlodash.reduceright@^3.1.0
- Removedlodash.reject@^3.1.0
- Removedlodash.rest@^3.0.0
- Removedlodash.sample@^3.0.0
- Removedlodash.shuffle@^3.0.0
- Removedlodash.some@^3.2.0
- Removedlodash.sortby@^3.1.0
- Removedlodash.take@^3.0.0
- Removedlodash.without@^3.1.0
- Removedlodash._arraycopy@3.0.0(transitive)
- Removedlodash._arrayeach@3.0.0(transitive)
- Removedlodash._arrayevery@3.0.0(transitive)
- Removedlodash._arrayfilter@3.0.0(transitive)
- Removedlodash._arraymap@3.0.0(transitive)
- Removedlodash._basecallback@3.3.1(transitive)
- Removedlodash._basecompareascending@3.0.2(transitive)
- Removedlodash._basedifference@3.0.3(transitive)
- Removedlodash._baseeach@3.0.4(transitive)
- Removedlodash._baseeachright@3.0.3(transitive)
- Removedlodash._basefilter@3.0.0(transitive)
- Removedlodash._basefind@3.0.0(transitive)
- Removedlodash._basefindindex@3.6.0(transitive)
- Removedlodash._baseflatten@3.1.4(transitive)
- Removedlodash._baseforright@3.0.2(transitive)
- Removedlodash._baseget@3.7.2(transitive)
- Removedlodash._baseindexof@3.1.0(transitive)
- Removedlodash._baseisequal@3.0.7(transitive)
- Removedlodash._baserandom@3.0.1(transitive)
- Removedlodash._basereduce@3.0.2(transitive)
- Removedlodash._baseslice@3.0.3(transitive)
- Removedlodash._basesortby@3.0.0(transitive)
- Removedlodash._basevalues@3.0.0(transitive)
- Removedlodash._binaryindex@3.0.1(transitive)
- Removedlodash._binaryindexby@3.0.3(transitive)
- Removedlodash._bindcallback@3.0.1(transitive)
- Removedlodash._cacheindexof@3.0.2(transitive)
- Removedlodash._createaggregator@3.0.0(transitive)
- Removedlodash._createcache@3.1.2(transitive)
- Removedlodash._getnative@3.9.1(transitive)
- Removedlodash._invokepath@3.7.2(transitive)
- Removedlodash._isiterateecall@3.0.9(transitive)
- Removedlodash._toiterable@3.0.4(transitive)
- Removedlodash._topath@3.8.1(transitive)
- Removedlodash.countby@3.1.1(transitive)
- Removedlodash.difference@3.2.2(transitive)
- Removedlodash.drop@3.0.0(transitive)
- Removedlodash.every@3.2.3(transitive)
- Removedlodash.filter@3.1.1(transitive)
- Removedlodash.find@3.2.1(transitive)
- Removedlodash.foreach@3.0.3(transitive)
- Removedlodash.groupby@3.1.1(transitive)
- Removedlodash.gt@3.9.2(transitive)
- Removedlodash.includes@3.1.3(transitive)
- Removedlodash.indexby@3.1.1(transitive)
- Removedlodash.indexof@3.0.3(transitive)
- Removedlodash.initial@3.0.0(transitive)
- Removedlodash.invoke@3.2.3(transitive)
- Removedlodash.isarguments@3.1.0(transitive)
- Removedlodash.isarray@3.0.4(transitive)
- Removedlodash.isempty@3.0.4(transitive)
- Removedlodash.isfunction@3.0.9(transitive)
- Removedlodash.isstring@3.0.1(transitive)
- Removedlodash.istypedarray@3.0.6(transitive)
- Removedlodash.keys@3.1.2(transitive)
- Removedlodash.lastindexof@3.0.2(transitive)
- Removedlodash.lt@3.9.2(transitive)
- Removedlodash.map@3.1.4(transitive)
- Removedlodash.max@3.4.0(transitive)
- Removedlodash.min@3.4.0(transitive)
- Removedlodash.pairs@3.0.1(transitive)
- Removedlodash.partition@3.1.1(transitive)
- Removedlodash.reduce@3.1.2(transitive)
- Removedlodash.reduceright@3.1.2(transitive)
- Removedlodash.reject@3.1.1(transitive)
- Removedlodash.rest@3.0.0(transitive)
- Removedlodash.restparam@3.6.1(transitive)
- Removedlodash.sample@3.1.0(transitive)
- Removedlodash.shuffle@3.1.0(transitive)
- Removedlodash.some@3.2.3(transitive)
- Removedlodash.sortby@3.1.5(transitive)
- Removedlodash.take@3.0.0(transitive)
- Removedlodash.toarray@3.0.2(transitive)
- Removedlodash.values@3.0.0(transitive)
- Removedlodash.without@3.2.1(transitive)