diff --git a/lib/lodash.js b/lib/lodash.js new file mode 100644 index 0000000..72844f8 --- /dev/null +++ b/lib/lodash.js @@ -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"); +} diff --git a/package.json b/package.json index 141fcca..8abfa04 100644 --- a/package.json +++ b/package.json @@ -46,6 +46,7 @@ "async": "0.9.0", "express": "4.10.5", "body-parser": "1.10.0", - "robeaux": "0.3.0" + "robeaux": "0.3.0", + "lodash": "2.4.1" } }