mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-02 08:07:50 +00:00
Move _.pluck and _.invoke back to the "Collections" category and optimize _.sortedIndex when a callback is passed.
Former-commit-id: d16763e7d35660d8ba9ea976c8b2a4dc20f1211f
This commit is contained in:
26
test/test.js
26
test/test.js
@@ -378,6 +378,17 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.invoke');
|
||||
|
||||
(function() {
|
||||
test('should work with an object for `collection`', function() {
|
||||
var object = { 'a': 1, 'b': 2, 'c': 3 };
|
||||
deepEqual(_.invoke(object, 'toFixed', 1), ['1.0', '2.0', '3.0']);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.isEmpty');
|
||||
|
||||
(function() {
|
||||
@@ -520,6 +531,17 @@
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.pluck');
|
||||
|
||||
(function() {
|
||||
test('should work with an object for `collection`', function() {
|
||||
var object = { 'a': [1], 'b': [1, 2], 'c': [1, 2, 3] };
|
||||
deepEqual(_.pluck(object, 'length'), [1, 2, 3]);
|
||||
});
|
||||
}());
|
||||
|
||||
/*--------------------------------------------------------------------------*/
|
||||
|
||||
QUnit.module('lodash.reduceRight');
|
||||
|
||||
(function() {
|
||||
@@ -743,12 +765,10 @@
|
||||
'indexOf',
|
||||
'initial',
|
||||
'intersection',
|
||||
'invoke',
|
||||
'last',
|
||||
'lastIndexOf',
|
||||
'max',
|
||||
'min',
|
||||
'pluck',
|
||||
'range',
|
||||
'rest',
|
||||
'shuffle',
|
||||
@@ -782,7 +802,9 @@
|
||||
'filter',
|
||||
'find',
|
||||
'forEach',
|
||||
'invoke',
|
||||
'map',
|
||||
'pluck',
|
||||
'reduce',
|
||||
'reduceRight',
|
||||
'reject',
|
||||
|
||||
Reference in New Issue
Block a user