mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
Cleanup _.compose.
This commit is contained in:
@@ -4665,17 +4665,14 @@
|
|||||||
*/
|
*/
|
||||||
function compose() {
|
function compose() {
|
||||||
var funcs = arguments,
|
var funcs = arguments,
|
||||||
length = funcs.length;
|
funcsLength = funcs.length,
|
||||||
|
length = funcsLength;
|
||||||
|
|
||||||
while (length--) {
|
while (length--) {
|
||||||
if (!isFunction(funcs[length])) {
|
if (!isFunction(funcs[length])) {
|
||||||
throw new TypeError;
|
throw new TypeError;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
var funcsLength = funcs.length;
|
|
||||||
if (funcsLength === 1) {
|
|
||||||
return funcs[0];
|
|
||||||
}
|
|
||||||
return function() {
|
return function() {
|
||||||
var length = funcsLength - 1,
|
var length = funcsLength - 1,
|
||||||
result = funcs[length].apply(this, arguments);
|
result = funcs[length].apply(this, arguments);
|
||||||
|
|||||||
Reference in New Issue
Block a user