mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-11 03:17:49 +00:00
Make _.at support shortcut fusion in a chain sequence when operating on an array and selecting a single index. [closes #1636]
This commit is contained in:
@@ -13893,6 +13893,13 @@
|
||||
};
|
||||
});
|
||||
|
||||
LazyWrapper.prototype.at = rest(function(paths) {
|
||||
paths = baseFlatten(paths);
|
||||
return (paths.length == 1 && isIndex(paths[0]))
|
||||
? this.slice(paths[0], paths[0] + 1)
|
||||
: new LazyWrapper(this);
|
||||
});
|
||||
|
||||
LazyWrapper.prototype.compact = function() {
|
||||
return this.filter(identity);
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user