mirror of
https://github.com/whoisclebs/lodash.git
synced 2026-02-09 18:37:50 +00:00
Simplify lib/fp/fp.js.
This commit is contained in:
13
lib/fp/fp.js
13
lib/fp/fp.js
@@ -12,17 +12,10 @@ var _ = require('lodash'),
|
|||||||
*/
|
*/
|
||||||
function convert() {
|
function convert() {
|
||||||
var args = arguments,
|
var args = arguments,
|
||||||
name = args[0],
|
name = args.length ? args[0] : _.runInContext(),
|
||||||
func = args[1],
|
func = args[1];
|
||||||
length = args.length;
|
|
||||||
|
|
||||||
if (length == 1) {
|
return base(util, name, func);
|
||||||
func = name;
|
|
||||||
name = undefined;
|
|
||||||
}
|
|
||||||
return length
|
|
||||||
? base(util, name, func)
|
|
||||||
: base(util, _.runInContext());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = convert;
|
module.exports = convert;
|
||||||
|
|||||||
Reference in New Issue
Block a user