mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-10 02:47:50 +00:00
Simplify lazyValue.
This commit is contained in:
@@ -4766,11 +4766,8 @@
|
|||||||
* @returns {*} Returns the unwrapped value.
|
* @returns {*} Returns the unwrapped value.
|
||||||
*/
|
*/
|
||||||
function lazyValue() {
|
function lazyValue() {
|
||||||
var array = this.wrapped;
|
var array = this.wrapped.value(),
|
||||||
if (array instanceof LodashWrapper || array instanceof LazyWrapper) {
|
length = array.length,
|
||||||
array = array.value();
|
|
||||||
}
|
|
||||||
var length = array.length,
|
|
||||||
start = 0,
|
start = 0,
|
||||||
end = length,
|
end = length,
|
||||||
views = this.views,
|
views = this.views,
|
||||||
@@ -9936,7 +9933,7 @@
|
|||||||
});
|
});
|
||||||
|
|
||||||
// add `LazyWrapper` methods for `_.drop` and `_.take` variants
|
// add `LazyWrapper` methods for `_.drop` and `_.take` variants
|
||||||
arrayEach(['drop', 'take'], function(methodName, index) {
|
arrayEach(['drop', 'take'], function(methodName) {
|
||||||
var countName = methodName + 'Count',
|
var countName = methodName + 'Count',
|
||||||
whileName = methodName + 'While';
|
whileName = methodName + 'While';
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user