Add Lo-Dash + loader

This commit is contained in:
Andrew Stewart 2014-12-17 13:00:59 -08:00
parent 6bffc20020
commit 34ed6cea02
2 changed files with 23 additions and 1 deletions

21
lib/lodash.js Normal file
View File

@ -0,0 +1,21 @@
"use strict";
// loader for Lo-Dash.
//
// will load the compatability version on JS implementations with less support
// for ES5 features (Tessel, etc)
var isTessel = function() {
try {
require("tessel");
return true;
} catch (e) {
return false;
}
};
if (isTessel()) {
module.exports = require("lodash/dist/lodash.compat");
} else {
module.exports = require("lodash");
}

View File

@ -46,6 +46,7 @@
"async": "0.9.0", "async": "0.9.0",
"express": "4.10.5", "express": "4.10.5",
"body-parser": "1.10.0", "body-parser": "1.10.0",
"robeaux": "0.3.0" "robeaux": "0.3.0",
"lodash": "2.4.1"
} }
} }