From 695d6e14d49b0e9561938e2fff65de4a651d52af Mon Sep 17 00:00:00 2001 From: John-David Dalton Date: Sat, 3 May 2014 21:42:19 -0700 Subject: [PATCH] Remove `_.at` guard for `_.map` use. --- lodash.js | 9 ++------- test/test.js | 7 ------- 2 files changed, 2 insertions(+), 14 deletions(-) diff --git a/lodash.js b/lodash.js index 9651ec14a..05589fcb0 100644 --- a/lodash.js +++ b/lodash.js @@ -3610,17 +3610,12 @@ * _.at(['fred', 'barney', 'pebbles'], 0, 2); * // => ['fred', 'pebbles'] */ - function at(collection, guard) { + function at(collection) { var args = arguments, index = -1, props = baseFlatten(args, true, false, 1), - length = props.length, - type = typeof guard; + length = props.length; - // enables use as a callback for functions like `_.map` - if ((type == 'number' || type == 'string') && args[2] && args[2][guard] === collection) { - length = 1; - } if (support.unindexedChars && isString(collection)) { collection = collection.split(''); } diff --git a/test/test.js b/test/test.js index df7571744..68b4f3a26 100644 --- a/test/test.js +++ b/test/test.js @@ -693,13 +693,6 @@ deepEqual(actual, [1, 3]); }); - test('should work when used as a callback for `_.map`', 1, function() { - var array = [[1, 2, 3], [4, 5, 6], [7, 8, 9]], - actual = _.map(array, _.at); - - deepEqual(actual, [[1], [5], [9]]); - }); - _.each({ 'literal': 'abc', 'object': Object('abc')