mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-03 16:47:49 +00:00
Bump to v4.4.0.
This commit is contained in:
11
wrapperAt.js
11
wrapperAt.js
@@ -26,17 +26,22 @@ import thru from './thru';
|
||||
* // => ['a', 'c']
|
||||
*/
|
||||
var wrapperAt = rest(function(paths) {
|
||||
paths = baseFlatten(paths);
|
||||
paths = baseFlatten(paths, 1);
|
||||
var length = paths.length,
|
||||
start = length ? paths[0] : 0,
|
||||
value = this.__wrapped__,
|
||||
interceptor = function(object) { return baseAt(object, paths); };
|
||||
|
||||
if (length > 1 || this.__actions__.length || !(value instanceof LazyWrapper) || !isIndex(start)) {
|
||||
if (length > 1 || this.__actions__.length ||
|
||||
!(value instanceof LazyWrapper) || !isIndex(start)) {
|
||||
return this.thru(interceptor);
|
||||
}
|
||||
value = value.slice(start, +start + (length ? 1 : 0));
|
||||
value.__actions__.push({ 'func': thru, 'args': [interceptor], 'thisArg': undefined });
|
||||
value.__actions__.push({
|
||||
'func': thru,
|
||||
'args': [interceptor],
|
||||
'thisArg': undefined
|
||||
});
|
||||
return new LodashWrapper(value, this.__chain__).thru(function(array) {
|
||||
if (length && !array.length) {
|
||||
array.push(undefined);
|
||||
|
||||
Reference in New Issue
Block a user