Have browser fp convert auto wrap lodash if found.

This commit is contained in:
John-David Dalton
2016-02-11 12:58:38 -08:00
parent 641112dd4d
commit 8c5b64c7d7
2 changed files with 13 additions and 6 deletions

View File

@@ -11,4 +11,7 @@ function browserConvert(lodash, options) {
return baseConvert(lodash, lodash, options);
}
if (typeof _ == 'function') {
_ = browserConvert(_.runInContext());
}
module.exports = browserConvert;

View File

@@ -35,10 +35,11 @@
));
/** Load stable Lodash and QUnit Extras. */
var _ = root._ || load('../lodash.js');
if (_) {
_ = _.runInContext(root);
}
var _ = root._ || (root._ = (
_ = load('../lodash.js'),
_.runInContext(root)
));
var QUnitExtras = load('../node_modules/qunit-extras/qunit-extras.js');
if (QUnitExtras) {
QUnitExtras.runInContext(root);
@@ -63,8 +64,11 @@
};
}());
var mapping = root.mapping || load('../fp/_mapping.js'),
fp = convert(_.runInContext());
var fp = root.fp
? (fp = _.noConflict(), _ = root._, fp)
: convert(_.runInContext());
var mapping = root.mapping || load('../fp/_mapping.js');
/*--------------------------------------------------------------------------*/